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 $quote = ' $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 binary(10), c3 binary(30), c4 binary(40), c5 binary(50), c6 nchar(10), c7 nchar(20), c8 nchar(30), c9 nchar(40)) TAGS (tgcol int) $i = 0 while $i < $tbNum $tb = $tbPrefix . $i sql create table $tb using $mt tags( $i ) $x = 0 $z2 = $x . 2 $y2 = $quote . $z2 $y2 = $y2 . $quote $z3 = $x . 3 $y3 = $quote . $z3 $y3 = $y3 . $quote $z4 = $x . 4 $y4 = $quote . $z4 $y4 = $y4 . $quote $z5 = $x . 5 $y5 = $quote . $z5 $y5 = $y5 . $quote $z6 = $x . 6 $y6 = $quote . $z6 $y6 = $y6 . $quote $z7 = $x . 7 $y7 = $quote . $z7 $y7 = $y7 . $quote $z8 = $x . 8 $y8 = $quote . $z8 $y8 = $y8 . $quote $z9 = $x . 9 $y9 = $quote . $z9 $y9 = $y9 . $quote while $x < $rowNum $cc = $x * 60000 $ms = 1601481600000 + $cc sql insert into $tb values ($ms , $x , $y2 , $y3 , $y4 , $y5 , $y6 , $y7 , $y8 , $y9 ) $x = $x + 1 $z2 = $x . 2 $y2 = $quote . $z2 $y2 = $y2 . $quote $z3 = $x . 3 $y3 = $quote . $z3 $y3 = $y3 . $quote $z4 = $x . 4 $y4 = $quote . $z4 $y4 = $y4 . $quote $z5 = $x . 5 $y5 = $quote . $z5 $y5 = $y5 . $quote $z6 = $x . 6 $y6 = $quote . $z6 $y6 = $y6 . $quote $z7 = $x . 7 $y7 = $quote . $z7 $y7 = $y7 . $quote $z8 = $x . 8 $y8 = $quote . $z8 $y8 = $y8 . $quote $z9 = $x . 9 $y9 = $quote . $z9 $y9 = $y9 . $quote endw $i = $i + 1 endw print ================= step2 $i = 1 $tb = $tbPrefix . $i $stb = $mtPrefix . 0 print sql select concat(c2, c3, c4, c5) from $tb sql select concat(c2, c3, c4, c5) from $tb print $data00 if $data00 != 02030405 then return -1 endi print sql select concat_ws('data',c2,c3,c4,c5) from $tb sql select concat_ws('data',c2,c3,c4,c5) from $tb print $data00 if $data00 != 02data03data04data05 then return -1 endi print sql select concat(c6, c7, c8, c9) from $tb sql select concat(c6, c7, c8, c9) from $tb print $data00 if $data00 != 06070809 then return -1 endi print sql select concat_ws('data' ,c6,c7,c8,c9) from $tb sql select concat_ws('data' ,c6,c7,c8,c9) from $tb print $data00 if $data00 != 06data07data08data09 then return -1 endi print sql select length(concat(c2, c3, c4, c5)) from $tb sql select length(concat(c2, c3, c4, c5)) from $tb print $data00 if $data00 != 8 then return -1 endi print sql select char_length(concat(c2, c3, c4, c5)) from $tb sql select char_length(concat(c2, c3, c4, c5)) from $tb print $data00 if $data00 != 8 then return -1 endi print sql select length(concat_ws('data',c2,c3,c4,c5)) from $tb sql select length(concat_ws('data',c2,c3,c4,c5)) from $tb print $data00 if $data00 != 20 then return -1 endi print sql select char_length(concat_ws('data',c2,c3,c4,c5)) from $tb sql select char_length(concat_ws('data',c2,c3,c4,c5)) from $tb print $data00 if $data00 != 20 then return -1 endi print sql select length(concat(c6, c7, c8, c9)) from $tb sql select length(concat(c6, c7, c8, c9)) from $tb print $data00 if $data00 != 32 then return -1 endi print sql select char_length(concat(c6, c7, c8, c9)) from $tb sql select char_length(concat(c6, c7, c8, c9)) from $tb print $data00 if $data00 != 8 then return -1 endi print sql select length(concat_ws('data' ,c6,c7,c8,c9)) from $tb sql select length(concat_ws('data' ,c6,c7,c8,c9)) from $tb print $data00 if $data00 != 80 then return -1 endi print sql select char_length(concat_ws('data', c6,c7,c8,c9)) from $tb sql select char_length(concat_ws('data', c6, c7, c8, c9)) from $tb print $data00 if $data00 != 20 then return -1 endi print sql_error select concat(c1, c2, c3, c4, c5) from $tb sql_error select concat(c1, c2, c3, c4, c5) from $tb print sql_error select concat_ws('data',c1,c2,c3,c4,c5) from $tb sql_error select concat_ws('data',c1,c2,c3,c4,c5) from $tb print ===============> step 3 sql_error stable, group by, window sql_error select concat(c2) from $stb group by tbname; sql_error select concat(c2) from $stb group by tgcol; sql_error select concat(c2) from $stb group by c3; sql_error select concat(c2) from $stb interval(1m); sql_error select concat(c2) from $stb state_window(c7); sql_error select concat(c2) from $tb state_window(c7); sql_error select concat(c2) from $stb session(ts, 30s); sql_error select concat(c2) from $tb session(ts, 30s); sql_error select concat(c2) from $stb slimit 2; sql_error select concat(c2) from $stb interval(1m) slimit 2; sql_error select length(c2) from $stb group by tbname; sql_error select length(c2) from $stb group by tgcol; sql_error select length(c2) from $stb group by c3; sql_error select length(c2) from $stb interval(1m); sql_error select length(c2) from $stb state_window(c7); sql_error select length(c2) from $tb state_window(c7); sql_error select length(c2) from $stb session(ts, 30s); sql_error select length(c2) from $tb session(ts, 30s); sql_error select length(c2) from $stb slimit 2; sql_error select length(c2) from $stb interval(1m) slimit 2; sql_error select concat_ws(c2) from $stb group by tbname; sql_error select concat_ws(c2) from $stb group by tgcol; sql_error select concat_ws(c2) from $stb group by c3; sql_error select concat_ws(c2) from $stb interval(1m); sql_error select concat_ws(c2) from $stb state_window(c7); sql_error select concat_ws(c2) from $tb state_window(c7); sql_error select concat_ws(c2) from $stb session(ts, 30s); sql_error select concat_ws(c2) from $tb session(ts, 30s); sql_error select concat_ws(c2) from $stb slimit 2; sql_error select concat_ws(c2) from $stb interval(1m) slimit 2; sql_error select char_length(c2) from $stb group by tbname; sql_error select char_length(c2) from $stb group by tgcol; sql_error select char_length(c2) from $stb group by c3; sql_error select char_length(c2) from $stb interval(1m); sql_error select char_length(c2) from $stb state_window(c7); sql_error select char_length(c2) from $tb state_window(c7); sql_error select char_length(c2) from $stb session(ts, 30s); sql_error select char_length(c2) from $tb session(ts, 30s); sql_error select char_length(c2) from $stb slimit 2; sql_error select char_length(c2) from $stb interval(1m) slimit 2; print =============== trival test print execute sql select concat(c2,c3),concat(c2,c3,c4),concat(c2,c3,c4,c5) from ct1 sql select concat(c2,c3),concat(c2,c3,c4),concat(c2,c3,c4,c5) from ct1 if $rows != 50 then return -1 endi if $data00 != @0203@ then return -1 endi if $data01 != @020304@ then return -1 endi if $data02 != @02030405@ then return -1 endi if $data10 != @1213@ then return -1 endi if $data11 != @121314@ then return -1 endi if $data12 != @12131415@ then return -1 endi print execute sql select concat('taos',c2,c3),concat('taos',c2,c4),concat('taos',c2,c5),concat('taos',c3,c4),concat('taos',c3,c5) from ct1 sql select concat('taos',c2,c3),concat('taos',c2,c4),concat('taos',c2,c5),concat('taos',c3,c4),concat('taos',c3,c5) from ct1 if $rows != 50 then return -1 endi if $data00 != @taos0203@ then return -1 endi if $data01 != @taos0204@ then return -1 endi if $data02 != @taos0205@ then return -1 endi if $data03 != @taos0304@ then return -1 endi if $data04 != @taos0305@ then return -1 endi if $data10 != @taos1213@ then return -1 endi if $data11 != @taos1214@ then return -1 endi if $data12 != @taos1215@ then return -1 endi if $data13 != @taos1314@ then return -1 endi if $data14 != @taos1315@ then return -1 endi print execute sql select concat(c6,c7,'taos'),concat(c6,c8,'taos'),concat(c6,c9,'taos'),concat(c7,c8,'taos'),concat(c7,c9,'taos') from ct1 sql select concat(c6,c7,'taos'),concat(c6,c8,'taos'),concat(c6,c9,'taos'),concat(c7,c8,'taos'),concat(c7,c9,'taos') from ct1 if $rows != 50 then return -1 endi if $data00 != @0607taos@ then return -1 endi if $data01 != @0608taos@ then return -1 endi if $data02 != @0609taos@ then return -1 endi if $data03 != @0708taos@ then return -1 endi if $data04 != @0709taos@ then return -1 endi if $data10 != @1617taos@ then return -1 endi if $data11 != @1618taos@ then return -1 endi if $data12 != @1619taos@ then return -1 endi if $data13 != @1718taos@ then return -1 endi if $data14 != @1719taos@ then return -1 endi print execute sql select concat('data',c7,'taos'),concat('data',c8,'taos'),concat('data',c9,'taos'),concat(c7,c8,'taos'),concat(c7,c9,'taos') from ct1 sql select concat('data',c7,'taos'),concat('data',c8,'taos'),concat('data',c9,'taos'),concat(c7,c8,'taos'),concat(c7,c9,'taos') from ct1 if $rows != 50 then return -1 endi if $data00 != @data07taos@ then return -1 endi if $data01 != @data08taos@ then return -1 endi if $data02 != @data09taos@ then return -1 endi if $data03 != @0708taos@ then return -1 endi if $data04 != @0709taos@ then return -1 endi if $data10 != @data17taos@ then return -1 endi if $data11 != @data18taos@ then return -1 endi if $data12 != @data19taos@ then return -1 endi if $data13 != @1718taos@ then return -1 endi if $data14 != @1719taos@ then return -1 endi print execute sql select concat_ws('jeff',c2,c3),concat_ws('jeff',c2,c3,c4),concat_ws('jeff',c2,c3,c4,c5) from ct1 sql select concat_ws('jeff',c2,c3),concat_ws('jeff',c2,c3,c4),concat_ws('jeff',c2,c3,c4,c5) from ct1 if $rows != 50 then return -1 endi if $data00 != @02jeff03@ then return -1 endi if $data01 != @02jeff03jeff04@ then return -1 endi if $data02 != @02jeff03jeff04jeff05@ then return -1 endi if $data10 != @12jeff13@ then return -1 endi if $data11 != @12jeff13jeff14@ then return -1 endi if $data12 != @12jeff13jeff14jeff15@ then return -1 endi print execute sql select concat_ws('jeff','taos',c2,c3),concat_ws('jeff','taos',c2,c4),concat_ws('jeff','taos',c2,c5),concat_ws('jeff','taos',c3,c4),concat_ws('jeff','taos',c3,c5) from ct1 sql select concat_ws('jeff','taos',c2,c3),concat_ws('jeff','taos',c2,c4),concat_ws('jeff','taos',c2,c5),concat_ws('jeff','taos',c3,c4),concat_ws('jeff','taos',c3,c5) from ct1 if $rows != 50 then return -1 endi if $data00 != @taosjeff02jeff03@ then return -1 endi if $data01 != @taosjeff02jeff04@ then return -1 endi if $data02 != @taosjeff02jeff05@ then return -1 endi if $data03 != @taosjeff03jeff04@ then return -1 endi if $data04 != @taosjeff03jeff05@ then return -1 endi if $data10 != @taosjeff12jeff13@ then return -1 endi if $data11 != @taosjeff12jeff14@ then return -1 endi if $data12 != @taosjeff12jeff15@ then return -1 endi if $data13 != @taosjeff13jeff14@ then return -1 endi if $data14 != @taosjeff13jeff15@ then return -1 endi print execute sql select concat_ws('jeff','data',c3),concat_ws('jeff','data',c3,c4),concat_ws('jeff','data',c3,c4,c5) from ct1 sql select concat_ws('jeff','data',c3),concat_ws('jeff','data',c3,c4),concat_ws('jeff','data',c3,c4,c5) from ct1 if $rows != 50 then return -1 endi if $data00 != @datajeff03@ then return -1 endi if $data01 != @datajeff03jeff04@ then return -1 endi if $data02 != @datajeff03jeff04jeff05@ then return -1 endi if $data10 != @datajeff13@ then return -1 endi if $data11 != @datajeff13jeff14@ then return -1 endi if $data12 != @datajeff13jeff14jeff15@ then return -1 endi print execute sql select concat_ws('jeff','data',c7,'taos'),concat_ws('jeff','data',c8,'taos'),concat_ws('jeff','data',c9,'taos'),concat_ws('jeff',c7,c8,'taos'),concat_ws('jeff',c7,c9,'taos') from ct1 sql select concat_ws('jeff','data',c7,'taos'),concat_ws('jeff','data',c8,'taos'),concat_ws('jeff','data',c9,'taos'),concat_ws('jeff',c7,c8,'taos'),concat_ws('jeff',c7,c9,'taos') from ct1 if $rows != 50 then return -1 endi if $data00 != @datajeff07jefftaos@ then return -1 endi if $data01 != @datajeff08jefftaos@ then return -1 endi if $data02 != @datajeff09jefftaos@ then return -1 endi if $data03 != @07jeff08jefftaos@ then return -1 endi if $data04 != @07jeff09jefftaos@ then return -1 endi if $data10 != @datajeff17jefftaos@ then return -1 endi if $data11 != @datajeff18jefftaos@ then return -1 endi if $data12 != @datajeff19jefftaos@ then return -1 endi if $data13 != @17jeff18jefftaos@ then return -1 endi if $data14 != @17jeff19jefftaos@ then return -1 endi print execute sql select length(concat(c2,c3)),length(concat(c2,c3,c4)),length(concat(c2,c3,c4,c5)) from ct1 sql select length(concat(c2,c3)),length(concat(c2,c3,c4)),length(concat(c2,c3,c4,c5)) from ct1 if $rows != 50 then return -1 endi if $data00 != @4@ then return -1 endi if $data01 != @6@ then return -1 endi if $data02 != @8@ then return -1 endi if $data10 != @4@ then return -1 endi if $data11 != @6@ then return -1 endi if $data12 != @8@ then return -1 endi print execute sql select length(concat(c6,c7,'taos')),length(concat(c6,c8,'taos')),length(concat(c6,c9,'taos')),length(concat(c7,c8,'taos')),length(concat(c7,c9,'taos')) from ct1 sql select length(concat(c6,c7,'taos')),length(concat(c6,c8,'taos')),length(concat(c6,c9,'taos')),length(concat(c7,c8,'taos')),length(concat(c7,c9,'taos')) from ct1 if $rows != 50 then return -1 endi if $data00 != @32@ then return -1 endi if $data01 != @32@ then return -1 endi if $data02 != @32@ then return -1 endi if $data03 != @32@ then return -1 endi if $data04 != @32@ then return -1 endi if $data10 != @32@ then return -1 endi if $data11 != @32@ then return -1 endi if $data12 != @32@ then return -1 endi if $data13 != @32@ then return -1 endi if $data14 != @32@ then return -1 endi print execute sql select length(concat_ws('jeff','taos',c2,c3)),length(concat_ws('jeff','taos',c2,c4)),length(concat_ws('jeff','taos',c2,c5)),length(concat_ws('jeff','taos',c3,c4)),length(concat_ws('jeff','taos',c3,c5)) from ct1 sql select length(concat_ws('jeff','taos',c2,c3)),length(concat_ws('jeff','taos',c2,c4)),length(concat_ws('jeff','taos',c2,c5)),length(concat_ws('jeff','taos',c3,c4)),length(concat_ws('jeff','taos',c3,c5)) from ct1 if $rows != 50 then return -1 endi if $data00 != @16@ then return -1 endi if $data01 != @16@ then return -1 endi if $data02 != @16@ then return -1 endi if $data03 != @16@ then return -1 endi if $data04 != @16@ then return -1 endi if $data10 != @16@ then return -1 endi if $data11 != @16@ then return -1 endi if $data12 != @16@ then return -1 endi if $data13 != @16@ then return -1 endi if $data14 != @16@ then return -1 endi print execute sql select length(concat_ws('jeff',c6,c7,'taos')),length(concat_ws('jeff',c6,c8,'taos')),length(concat_ws('jeff',c6,c9,'taos')),length(concat_ws('jeff',c7,c8,'taos')),length(concat_ws('jeff',c7,c9,'taos')) from ct1 sql select length(concat_ws('jeff',c6,c7,'taos')),length(concat_ws('jeff',c6,c8,'taos')),length(concat_ws('jeff',c6,c9,'taos')),length(concat_ws('jeff',c7,c8,'taos')),length(concat_ws('jeff',c7,c9,'taos')) from ct1 if $rows != 50 then return -1 endi if $data00 != @64@ then return -1 endi if $data01 != @64@ then return -1 endi if $data02 != @64@ then return -1 endi if $data03 != @64@ then return -1 endi if $data04 != @64@ then return -1 endi if $data10 != @64@ then return -1 endi if $data11 != @64@ then return -1 endi if $data12 != @64@ then return -1 endi if $data13 != @64@ then return -1 endi if $data14 != @64@ then return -1 endi print execute sql select char_length(concat(c2,'taos',c3)),char_length(concat(c2,'taos',c4)),char_length(concat(c2,'taos',c5)),char_length(concat(c3,'taos',c4)),char_length(concat(c3,'taos',c5)) from ct1 sql select char_length(concat(c2,'taos',c3)),char_length(concat(c2,'taos',c4)),char_length(concat(c2,'taos',c5)),char_length(concat(c3,'taos',c4)),char_length(concat(c3,'taos',c5)) from ct1 if $rows != 50 then return -1 endi if $data00 != @8@ then return -1 endi if $data01 != @8@ then return -1 endi if $data02 != @8@ then return -1 endi if $data03 != @8@ then return -1 endi if $data04 != @8@ then return -1 endi if $data10 != @8@ then return -1 endi if $data11 != @8@ then return -1 endi if $data12 != @8@ then return -1 endi if $data13 != @8@ then return -1 endi if $data14 != @8@ then return -1 endi print execute sql select char_length(concat(c6,'taos')),char_length(concat(c7,'taos')),char_length(concat(c8,'taos')),char_length(concat(c9,'taos')) from ct1 sql select char_length(concat(c6,'taos')),char_length(concat(c7,'taos')),char_length(concat(c8,'taos')),char_length(concat(c9,'taos')) from ct1 if $rows != 50 then return -1 endi if $data00 != @6@ then return -1 endi if $data01 != @6@ then return -1 endi if $data02 != @6@ then return -1 endi if $data03 != @6@ then return -1 endi if $data10 != @6@ then return -1 endi if $data11 != @6@ then return -1 endi if $data12 != @6@ then return -1 endi if $data13 != @6@ then return -1 endi print execute sql select char_length(concat_ws('jeff',c2,'taos',c3)),char_length(concat_ws('jeff',c2,'taos',c4)),char_length(concat_ws('jeff',c2,'taos',c5)),char_length(concat_ws('jeff',c3,'taos',c4)),char_length(concat_ws('jeff',c3,'taos',c5)) from ct1 sql select char_length(concat_ws('jeff',c2,'taos',c3)),char_length(concat_ws('jeff',c2,'taos',c4)),char_length(concat_ws('jeff',c2,'taos',c5)),char_length(concat_ws('jeff',c3,'taos',c4)),char_length(concat_ws('jeff',c3,'taos',c5)) from ct1 if $rows != 50 then return -1 endi if $data00 != @16@ then return -1 endi if $data01 != @16@ then return -1 endi if $data02 != @16@ then return -1 endi if $data03 != @16@ then return -1 endi if $data04 != @16@ then return -1 endi if $data10 != @16@ then return -1 endi if $data11 != @16@ then return -1 endi if $data12 != @16@ then return -1 endi if $data13 != @16@ then return -1 endi if $data14 != @16@ then return -1 endi print execute sql select char_length(concat_ws('jeff',c6,'taos')),char_length(concat_ws('jeff',c7,'taos')),char_length(concat_ws('jeff',c8,'taos')),char_length(concat_ws('jeff',c9,'taos')) from ct1 sql select char_length(concat_ws('jeff',c6,'taos')),char_length(concat_ws('jeff',c7,'taos')),char_length(concat_ws('jeff',c8,'taos')),char_length(concat_ws('jeff',c9,'taos')) from ct1 if $rows != 50 then return -1 endi if $data00 != @10@ then return -1 endi if $data01 != @10@ then return -1 endi if $data02 != @10@ then return -1 endi if $data03 != @10@ then return -1 endi if $data10 != @10@ then return -1 endi if $data11 != @10@ then return -1 endi if $data12 != @10@ then return -1 endi if $data13 != @10@ then return -1 endi 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