system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -i 1 system sh/cfg.sh -n dnode1 -c walLevel -v 1 system sh/exec.sh -n dnode1 -s start sleep 500 sql connect $dbPrefix = db $tbPrefix = ct $mtPrefix = st $tbNum = 2 $rowNum = 50 print =============== step1 create stable/table $i = 0 $db = $dbPrefix . $i $mt = $mtPrefix . $i sql drop database $db -x step1 step1: sql create database $db sql use $db sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 nchar(5), c9 binary(10)) TAGS (tgcol int) $i = 0 while $i < $tbNum $tb = $tbPrefix . $i sql create table $tb using $mt tags( $i ) $x = 0 $y = 0.25 while $x < $rowNum $cc = $x * 60000 $ms = 1601481600000 + $cc sql insert into $tb values ($ms , $x , $y , $x , $x , $x , $y , $x , $x , $x ) $x = $x + 1 $y = $y + 1 endw $i = $i + 1 endw print ================= step2 $stb = $mtPrefix . 0 $tb = $tbPrefix . 0 print execute sql select floor(3.0)+ceil(4.0) from $tb sql select floor(3.0)+ceil(4.0) from $tb if $rows != 50 then return -1 endi if $data00 != 7.000000000 then return -1 endi if $data10 != 7.000000000 then return -1 endi if $data20 != 7.000000000 then return -1 endi if $data30 != 7.000000000 then return -1 endi if $data40 != 7.000000000 then return -1 endi if $data50 != 7.000000000 then return -1 endi if $data60 != 7.000000000 then return -1 endi if $data70 != 7.000000000 then return -1 endi if $data80 != 7.000000000 then return -1 endi if $data90 != 7.000000000 then return -1 endi print execute sql select sum(c1)+3.0+4.0 from $stb sql select sum(c1)+3.0+4.0 from $stb if $rows != 1 then return -1 endi if $data00 != 2457.000000000 then return -1 endi print execute sql select sin(log(avg(c1),sum(c2))+3)%4 from $stb sql select sin(log(avg(c1),sum(c2))+3)%4 from $stb if $rows != 1 then return -1 endi if $data00 != -0.265074286 then return -1 endi print execute sql select select log(pow(length(concat('3','4')),2),c2) from $stb sql select log(pow(length(concat('3','4')),2),c2) from $stb print [ $data00 , $data10 , $data20 , $data30 , $data40 , $data50 , $data60 , $data70 , $data80 , $data90 ] if $data00 != -1.000000000 then return -1 endi if $data10 != @inf@ then return -1 endi if $data20 != 2.000000000 then return -1 endi if $data30 != 1.261859507 then return -1 endi if $data40 != 1.000000000 then return -1 endi if $data50 != 0.861353116 then return -1 endi if $data60 != 0.773705614 then return -1 endi if $data70 != 0.712414374 then return -1 endi if $data80 != 0.666666667 then return -1 endi if $data90 != 0.630929754 then return -1 endi print execute sql select round(log(pow(length(concat('3','4')),2),c2)+floor(c3))+2 from $stb sql select round(log(pow(length(concat('3','4')),2),c2)+floor(c3))+2 from $stb print [ $data00 , $data10 , $data20 , $data30 , $data40 , $data50 , $data60 , $data70 , $data80 , $data90 ] if $data00 != 1.000000000 then return -1 endi if $data10 != @inf@ then return -1 endi if $data20 != 4.000000000 then return -1 endi if $data30 != 3.000000000 then return -1 endi if $data40 != 3.000000000 then return -1 endi if $data50 != 3.000000000 then return -1 endi if $data60 != 3.000000000 then return -1 endi if $data70 != 3.000000000 then return -1 endi if $data80 != 3.000000000 then return -1 endi if $data90 != 3.000000000 then return -1 endi $tb0 = $tbPrefix . 0 $tb1 = $tbPrefix . 1 print execute sql select sin(pow(c1,log(c2,2))+pow(c2,2)) as val from $tb0 union all select pow(c4,2)+tan(sin(c5)/cos(c6)) as val from $tb1 sql select sin(pow(c1,log(c2,2))+pow(c2,2)) as val from $tb0 union all select pow(c4,2)+tan(sin(c5)/cos(c6)) as val from $tb1 print [ $data00 , $data10 , $data20 , $data30 , $data40 , $data50 , $data60 , $data70 , $data80 , $data90 ] if $data00 != @-nan@ then return -1 endi if $data10 != 0.909297427 then return -1 endi if $data20 != -0.279415498 then return -1 endi if $data30 != 0.843325058 then return -1 endi if $data40 != 0.551426681 then return -1 endi if $data50 != -0.840606612 then return -1 endi if $data60 != 0.436161076 then return -1 endi if $data70 != 0.897498185 then return -1 endi if $data80 != -0.885952778 then return -1 endi if $data90 != 0.429470715 then return -1 endi print ============== invalid expressions sql_error select agg(c1)+c2 from $stb sql_error select agg(c1+2) from $stb sql_error select agg(ceil(c1))+c2 from $stb sql_error select agg(ceil(c1)) from $stb print =============== clear sql drop database $db sql show databases if $rows != 0 then return -1 endi system sh/exec.sh -n dnode1 -s stop -x SIGINT