diff --git a/tests/script/tsim/tag/3.sim b/tests/script/tsim/tag/3.sim index ee794d6fc7bdc4f0aaf03ac55b36337033605dbf..1b8a9769805422b6da9669397886e825e8be73ec 100644 --- a/tests/script/tsim/tag/3.sim +++ b/tests/script/tsim/tag/3.sim @@ -24,496 +24,496 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgc $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0 ) + sql create table $tb using $mt tags( 0, 0, 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1 ) + sql create table $tb using $mt tags( 1, 1, 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step3 sql select * from $mt where tgcol1 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = false -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> false -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step4 sql select * from $mt where tgcol2 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where tgcol3 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step6 sql select * from $mt where ts > now + 4m and tgcol1 = true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> false -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> false and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step7 sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step8 sql select * from $mt where ts > now + 4m and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step9 sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol1 = true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol1 = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol1 = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> false -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step10 sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol1 = true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol1 = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol1 = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> false -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step11 sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step12 sql select * from $mt where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step13 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step14 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step15 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true and tgcol2 = 1 +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step16 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step17 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step18 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true and tgcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step19 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/4.sim b/tests/script/tsim/tag/4.sim index 7ad253bf14ac92bd6bb301f3f33dab87da013eb2..9ffe9703c6ce8e5bba4b7dd5918237d7c2d106ef 100644 --- a/tests/script/tsim/tag/4.sim +++ b/tests/script/tsim/tag/4.sim @@ -24,686 +24,686 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 bigi $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0, 0 ) + sql create table $tb using $mt tags( 0, 0, 0, 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1, 1 ) + sql create table $tb using $mt tags( 1, 1, 1, 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step3 sql select * from $mt where tgcol1 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step4 sql select * from $mt where tgcol2 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where tgcol3 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step6 sql select * from $mt where tgcol4 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol4 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol4 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol4 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step7 sql select * from $mt where ts > now + 4m and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step8 sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step9 sql select * from $mt where ts > now + 4m and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step10 sql select * from $mt where ts > now + 4m and tgcol4 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step11 sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step12 sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step13 sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step14 sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step15 sql select * from $mt where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step16 sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step17 sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step18 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step19 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step20 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step21 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol4 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step22 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step23 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step24 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d) +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/5.sim b/tests/script/tsim/tag/5.sim index eaf613e9d1c50961e1fb5419356fcfe4e6c93a7e..e1ac606dfe529a46ba48c5a1abe4bce0136626a6 100644 --- a/tests/script/tsim/tag/5.sim +++ b/tests/script/tsim/tag/5.sim @@ -24,809 +24,809 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 tinyint, tgcol2 int, $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0, 0, 0, '0' ) + sql create table $tb using $mt tags( 0, 0, 0, 0, '0' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1, 1, 1, '1' ) + sql create table $tb using $mt tags( 1, 1, 1, 1, '1' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step3 sql select * from $mt where tgcol1 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step4 sql select * from $mt where tgcol2 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where tgcol3 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step6 sql select * from $mt where tgcol4 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol4 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol4 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol4 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step7 sql select * from $mt where tgcol5 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol5 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol5 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol5 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step8 sql select * from $mt where ts > now + 4m and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step9 sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step10 sql select * from $mt where ts > now + 4m and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step11 sql select * from $mt where ts > now + 4m and tgcol4 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step12 sql select * from $mt where ts > now + 4m and tgcol5 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step13 sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step14 sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step15 sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step16 sql select * from $mt where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step17 sql select * from $mt where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step18 sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step19 sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step20 sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step21 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step22 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step23 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step24 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol4 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol5 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step25 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step26 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step27 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 partition by tgcol5 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/6.sim b/tests/script/tsim/tag/6.sim index 31aa5b1747347b05ba13df06488cd8365c28a599..655129255d2c6cec7e6543e8e3f728c294d3f6b4 100644 --- a/tests/script/tsim/tag/6.sim +++ b/tests/script/tsim/tag/6.sim @@ -24,964 +24,964 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 bi $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '0', 0, 0, 0, '0', '0' ) + sql create table $tb using $mt tags( '0', 0, 0, 0, '0', '0' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '1', 1, 1, 1, '1', '1' ) + sql create table $tb using $mt tags( '1', 1, 1, 1, '1', '1' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step3 sql select * from $mt where tgcol1 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol1 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step4 sql select * from $mt where tgcol2 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where tgcol3 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol3 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step6 sql select * from $mt where tgcol4 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol4 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol4 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol4 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step7 sql select * from $mt where tgcol5 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol5 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol5 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol5 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step8 sql select * from $mt where tgcol6 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol6 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol6 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol6 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step9 sql select * from $mt where ts > now + 4m and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step10 sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step11 sql select * from $mt where ts > now + 4m and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step12 sql select * from $mt where ts > now + 4m and tgcol4 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step13 sql select * from $mt where ts > now + 4m and tgcol5 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step14 sql select * from $mt where ts > now + 4m and tgcol6 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol6 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol6 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol6 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol6 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol6 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol6 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol6 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step15 sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step16 sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step17 sql select * from $mt where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step18 sql select * from $mt where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step19 sql select * from $mt where ts > now + 4m and tgcol5 = 1 and tgcol6 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 1 and tgcol6 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 = 0 and tgcol6 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 = 0 and tgcol6 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol6 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step20 sql select * from $mt where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step21 sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step22 sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step23 sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step24 sql select * from $mt where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step25 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step26 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step27 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step28 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol3 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol4 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol5 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol6 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step29 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step30 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step31 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol1 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol2 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 partition by tgcol3 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 partition by tgcol4 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 partition by tgcol5 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 partition by tgcol6 interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/add.sim b/tests/script/tsim/tag/add.sim index 78244d74c3f8664c7cb66ed8e484663a30696481..2b528c02552150b8a5dbe5a5115de3fe96144eb5 100644 --- a/tests/script/tsim/tag/add.sim +++ b/tests/script/tsim/tag/add.sim @@ -25,39 +25,39 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 int sql reset query cache -sql alter table $tb set tag tgcol4 =4 +sql alter table $tb set tag tgcol4 =4 sql reset query cache sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi @@ -71,61 +71,61 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 tinyint sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi sql select * from $mt where tgcol2 = 1 -x step3 return -1 step3: - + print =============== step4 $i = 4 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 2.00000 then @@ -134,34 +134,34 @@ endi sql describe $tb print sql describe $tb -if $data21 != BIGINT then +if $data21 != BIGINT then return -1 endi -if $data31 != FLOAT then +if $data31 != FLOAT then return -1 endi -if $data23 != TAG then +if $data23 != TAG then return -1 endi -if $data33 != TAG then +if $data33 != TAG then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 float sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 4.00000 then @@ -171,184 +171,184 @@ endi sql select * from $mt where tgcol2 = 1 -x step4 return -1 step4: - + print =============== step5 $i = 5 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10)) sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = '2' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 smallint sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi sql select * from $mt where tgcol3 = '1' -x step5 return -1 step5: - + print =============== step6 $i = 6 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 tinyint) sql create table $tb using $mt tags( 1, 2, 3 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql alter table $mt rename tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 binary(10) sql alter table $mt add tag tgcol6 binary(10) sql reset query cache -sql alter table $tb set tag tgcol4=false -sql alter table $tb set tag tgcol5='5' -sql alter table $tb set tag tgcol6='6' +sql alter table $tb set tag tgcol4=false +sql alter table $tb set tag tgcol5='5' +sql alter table $tb set tag tgcol6='6' sql reset query cache sql select * from $mt where tgcol5 = '5' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi -if $data04 != 6 then +if $data04 != 6 then return -1 endi sql select * from $mt where tgcol6 = '6' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi -if $data04 != 6 then +if $data04 != 6 then return -1 endi sql select * from $mt where tgcol4 = 1 -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where tgcol3 = 1 -x step52 return -1 step52: - + print =============== step7 $i = 7 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint, tgcol3 binary(10)) sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol3 = '3' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql alter table $mt rename tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 bigint sql alter table $mt add tag tgcol6 tinyint sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5=5 -sql alter table $tb set tag tgcol6=6 +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=6 sql reset query cache sql select * from $mt where tgcol6 = 6 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 4 then +if $data02 != 4 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi -if $data04 != 6 then +if $data04 != 6 then return -1 endi @@ -358,55 +358,55 @@ step71: sql select * from $mt where tgcol3 = 1 -x step72 return -1 step72: - + print =============== step8 $i = 8 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float, tgcol3 binary(10)) sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol3 = '3' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 2.00000 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql alter table $mt rename tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 binary(17) sql alter table $mt add tag tgcol6 bool sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5='5' +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5='5' sql alter table $tb set tag tgcol6='1' sql reset query cache sql select * from $mt where tgcol5 = '5' print select * from $mt where tgcol5 = 5 print $data01 $data02 $data03 $data04 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 4 then +if $data02 != 4 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi if $data04 != 0 then @@ -426,45 +426,45 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10), tgcol3 binary(10)) sql create table $tb using $mt tags( 1, '2', '3' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = '2' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql alter table $mt rename tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 bool sql alter table $mt add tag tgcol6 float sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql alter table $tb set tag tgcol5=1 sql alter table $tb set tag tgcol6=6 sql reset query cache sql select * from $mt where tgcol5 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 4.000000000 then +if $data02 != 4.000000000 then return -1 endi if $data03 != 1 then @@ -487,24 +487,24 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10)) sql create table $tb using $mt tags( '1', '2', '3', '4' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol4 = '4' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi @@ -512,7 +512,7 @@ sql alter table $mt rename tag tgcol1 tgcol4 -x step103 return -1 step103: -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt drop tag tgcol4 sql reset query cache @@ -520,28 +520,28 @@ sql alter table $mt add tag tgcol4 binary(10) sql alter table $mt add tag tgcol5 bool sql reset query cache -sql alter table $tb set tag tgcol4='4' +sql alter table $tb set tag tgcol4='4' sql alter table $tb set tag tgcol5=false sql reset query cache sql select * from $mt where tgcol4 = '4' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != null then return -1 endi @@ -558,27 +558,27 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 smallint, tgcol4 float, tgcol5 binary(10)) sql create table $tb using $mt tags( 1, 2, 3, 4, '5' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi if $data05 != 4.00000 then return -1 endi -if $data06 != 5 then +if $data06 != 5 then return -1 endi @@ -586,7 +586,7 @@ sql alter table $mt rename tag tgcol1 tgcol4 -x step114 return -1 step114: -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt drop tag tgcol4 sql alter table $mt drop tag tgcol5 @@ -598,7 +598,7 @@ sql alter table $mt add tag tgcol7 bigint sql alter table $mt add tag tgcol8 smallint sql reset query cache -sql alter table $tb set tag tgcol4='4' +sql alter table $tb set tag tgcol4='4' sql alter table $tb set tag tgcol5=5 sql alter table $tb set tag tgcol6='6' sql alter table $tb set tag tgcol7=7 @@ -607,28 +607,28 @@ sql reset query cache sql select * from $mt where tgcol5 =5 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi -if $data04 != 5 then +if $data04 != 5 then return -1 endi -if $data05 != 6 then +if $data05 != 6 then return -1 endi -if $data06 != 7 then +if $data06 != 7 then return -1 endi -if $data07 != 8 then +if $data07 != 8 then return -1 endi @@ -648,34 +648,34 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 smallint, tgcol3 float, tgcol4 double, tgcol5 binary(10), tgcol6 binary(20)) sql create table $tb using $mt tags( 1, 2, 3, 4, '5', '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi if $data04 != 3.00000 then return -1 endi -if $data05 != 4.000000000 then +if $data05 != 4.000000000 then return -1 endi -if $data06 != 5 then +if $data06 != 5 then return -1 endi -if $data07 != 6 then +if $data07 != 6 then return -1 endi -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt drop tag tgcol4 sql alter table $mt drop tag tgcol5 @@ -686,8 +686,8 @@ sql alter table $mt add tag tgcol4 binary(10) sql alter table $mt add tag tgcol5 bigint sql reset query cache -sql alter table $tb set tag tgcol1=false -sql alter table $tb set tag tgcol2='5' +sql alter table $tb set tag tgcol1=false +sql alter table $tb set tag tgcol2='5' sql alter table $tb set tag tgcol3=4 sql alter table $tb set tag tgcol4='3' sql alter table $tb set tag tgcol5=2 @@ -696,28 +696,28 @@ sql reset query cache sql select * from $mt where tgcol4 = '3' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 1 then +if $data03 != 1 then return -1 endi -if $data04 != 5 then +if $data04 != 5 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi -if $data06 != 3 then +if $data06 != 3 then return -1 endi -if $data07 != 2 then +if $data07 != 2 then return -1 endi @@ -747,34 +747,34 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20)) sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = '1' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi -if $data06 != 5.000000000 then +if $data06 != 5.000000000 then return -1 endi -if $data07 != 6 then +if $data07 != 6 then return -1 endi -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol4 sql alter table $mt drop tag tgcol6 sql reset query cache @@ -783,8 +783,8 @@ sql alter table $mt add tag tgcol4 int sql alter table $mt add tag tgcol6 bigint sql reset query cache -sql alter table $tb set tag tgcol1='7' -sql alter table $tb set tag tgcol2='8' +sql alter table $tb set tag tgcol1='7' +sql alter table $tb set tag tgcol2='8' sql alter table $tb set tag tgcol3=9 sql alter table $tb set tag tgcol4=10 sql alter table $tb set tag tgcol5=11 @@ -793,28 +793,28 @@ sql reset query cache sql select * from $mt where tgcol2 = '8' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 7 then +if $data02 != 7 then return -1 endi -if $data03 != 9 then +if $data03 != 9 then return -1 endi -if $data04 != 11.000000000 then +if $data04 != 11.000000000 then return -1 endi -if $data05 != 8 then +if $data05 != 8 then return -1 endi -if $data06 != 10 then +if $data06 != 10 then return -1 endi -if $data07 != 12 then +if $data07 != 12 then return -1 endi @@ -824,7 +824,7 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 bigint) sql create table $tb using $mt tags( 1, 1 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql alter table $mt add tag tgcol3 binary(10) sql alter table $mt add tag tgcol4 int @@ -834,13 +834,13 @@ sql alter table $mt add tag tgcol6 bigint sql reset query cache sql alter table $mt drop tag tgcol6 sql alter table $mt add tag tgcol7 bigint -sql alter table $mt add tag tgcol8 bigint +sql alter table $mt add tag tgcol8 bigint print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/bigint.sim b/tests/script/tsim/tag/bigint.sim index dc5a03152bdceb17c21ea5ed8652e6acaa09a646..26a5addf6a3f9d5e717b21b5003ac719d8b4d04d 100644 --- a/tests/script/tsim/tag/bigint.sim +++ b/tests/script/tsim/tag/bigint.sim @@ -24,50 +24,50 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bigint) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) + sql create table $tb using $mt tags( 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) + sql create table $tb using $mt tags( 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $tb -if $rows != $rowNum then +if $rows != $rowNum then return -1 endi sql select * from $tb where ts < now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts <= now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts > now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts >= now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then +if $rows != 1 then return -1 endi sql select * from $tb where ts < now + 4m and ts > now + 5m @@ -83,155 +83,155 @@ if $rows != 0 then return -1 endi sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== step3 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step4 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step7 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/binary.sim b/tests/script/tsim/tag/binary.sim index b3f243b8c014c419e05634e2db2845295fc527d4..e0c02b4823ca43f8ee783628776079ca1f57a3fa 100644 --- a/tests/script/tsim/tag/binary.sim +++ b/tests/script/tsim/tag/binary.sim @@ -24,50 +24,50 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(10)) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '0' ) + sql create table $tb using $mt tags( '0' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '1' ) + sql create table $tb using $mt tags( '1' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $tb -if $rows != $rowNum then +if $rows != $rowNum then return -1 endi sql select * from $tb where ts < now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts <= now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts > now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts >= now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then +if $rows != 1 then return -1 endi sql select * from $tb where ts < now + 4m and ts > now + 5m @@ -83,155 +83,155 @@ if $rows != 0 then return -1 endi sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== step3 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step4 sql select * from $mt where tgcol = '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> '0' -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> '0' -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> '0' and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step7 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/binary_binary.sim b/tests/script/tsim/tag/binary_binary.sim index ad6c0ca1cbb2101d43a5c08c2fb14e10e5da1bee..b5ba3562acd244116dd79d25a58adebb41f03474 100644 --- a/tests/script/tsim/tag/binary_binary.sim +++ b/tests/script/tsim/tag/binary_binary.sim @@ -24,283 +24,283 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(5), tgcol2 bina $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '0', '0' ) + sql create table $tb using $mt tags( '0', '0' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '1', '1' ) + sql create table $tb using $mt tags( '1', '1' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step3 sql select * from $mt where tgcol = '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> '0' -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step4 sql select * from $mt where tgcol2 = '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> '1' -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> '0' -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> '0' and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select * from $mt where ts > now + 4m and tgcol2 = '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step7 sql select * from $mt where ts > now + 4m and tgcol2 = '1' and tgcol = '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and tgcol <> '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = '0' and tgcol = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and tgcol <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and tgcol = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' and tgcol <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' and tgcol <> '0' -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m and ts < now + 5m and tgcol <> '0' -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' and tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' and tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step13 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step14 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/bool.sim b/tests/script/tsim/tag/bool.sim index c0f4c1ccdda2651d8d21add6573a2ff399b2f2ef..1473556841ddcf3ef08d0a11a651fb0571095385 100644 --- a/tests/script/tsim/tag/bool.sim +++ b/tests/script/tsim/tag/bool.sim @@ -24,50 +24,50 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) + sql create table $tb using $mt tags( 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) + sql create table $tb using $mt tags( 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $tb -if $rows != $rowNum then +if $rows != $rowNum then return -1 endi sql select * from $tb where ts < now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts <= now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts > now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts >= now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then +if $rows != 1 then return -1 endi sql select * from $tb where ts < now + 4m and ts > now + 5m @@ -79,40 +79,40 @@ if $rows != 0 then return -1 endi sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== step3 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step4 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 @@ -121,115 +121,115 @@ if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = false -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> false -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> false -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> false and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step7 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/bool_binary.sim b/tests/script/tsim/tag/bool_binary.sim index 627aea4495d42e294e4a24b5a55620e68f4c22ce..7fb15ec2cf541a553460014ed7eeabd7a9becede 100644 --- a/tests/script/tsim/tag/bool_binary.sim +++ b/tests/script/tsim/tag/bool_binary.sim @@ -24,283 +24,283 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 binary(5) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, '0' ) + sql create table $tb using $mt tags( 0, '0' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, '1' ) + sql create table $tb using $mt tags( 1, '1' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step3 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = false -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> false -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step4 sql select * from $mt where tgcol2 = '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> '1' -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> false -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> false and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select * from $mt where ts > now + 4m and tgcol2 = '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step7 sql select * from $mt where ts > now + 4m and tgcol2 = '1' and tgcol = true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and tgcol <> true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = '0' and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' and tgcol <> false -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m and ts < now + 5m and tgcol <> false -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true and tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true and tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step13 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step14 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/bool_int.sim b/tests/script/tsim/tag/bool_int.sim index 1e291573ef5c22a6c477cdb23d01cb4788fe43cf..f18da59d9cd94f650166bea938312a471907f322 100644 --- a/tests/script/tsim/tag/bool_int.sim +++ b/tests/script/tsim/tag/bool_int.sim @@ -24,299 +24,299 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 int) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0 ) + sql create table $tb using $mt tags( 0, 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1 ) + sql create table $tb using $mt tags( 1, 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step3 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = false -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> false -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step4 sql select * from $mt where tgcol2 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> true -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = false -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> false -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> false -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> false and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step7 sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol = true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol <> true -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol = false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol <> false -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol <> false -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol <> false -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = true and tgcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step13 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step14 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/change.sim b/tests/script/tsim/tag/change.sim index 53f9f493966986f00fa5cf5defb7b9f10f24d2bd..d44877c99a244ffd2c1060950f004c5a967d8406 100644 --- a/tests/script/tsim/tag/change.sim +++ b/tests/script/tsim/tag/change.sim @@ -25,18 +25,18 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi @@ -62,18 +62,18 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi @@ -86,15 +86,15 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 2.00000 then @@ -103,61 +103,61 @@ endi sql alter table $mt rename tag tgcol1 tgcol3 sql alter table $mt rename tag tgcol2 tgcol4 - + print =============== step5 $i = 5 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10)) sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = '2' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql alter table $mt rename tag tgcol1 tgcol3 sql alter table $mt rename tag tgcol2 tgcol4 - + print =============== step6 $i = 6 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20)) sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = '1' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi -if $data06 != 5.000000000 then +if $data06 != 5.000000000 then return -1 endi -if $data07 != 6 then +if $data07 != 6 then return -1 endi @@ -187,31 +187,31 @@ step25: sql select * from $mt where tgcol3 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql select * from $mt where tgcol4 = 2 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi @@ -229,34 +229,34 @@ step32: sql select * from $mt where tgcol3 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql select * from $mt where tgcol4 = 2 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi - + print =============== step4 $i = 4 $mt = $mtPrefix . $i @@ -271,13 +271,13 @@ step42: sql select * from $mt where tgcol3 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 2.00000 then @@ -298,7 +298,7 @@ endi if $data03 != 2.00000 then return -1 endi - + print =============== step5 $i = 5 $mt = $mtPrefix . $i @@ -313,34 +313,34 @@ step52: sql select * from $mt where tgcol3 < 2 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql select * from $mt where tgcol4 = '2' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi - + print =============== step6 $i = 6 $mt = $mtPrefix . $i @@ -367,144 +367,144 @@ step66: sql select * from $mt where tgcol7 = '1' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 4 then +if $data04 != 4 then return -1 endi -if $data05 != 5.000000000 then +if $data05 != 5.000000000 then return -1 endi -if $data06 != 6 then +if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi sql select * from $mt where tgcol8 = 2 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 4 then +if $data04 != 4 then return -1 endi -if $data05 != 5.000000000 then +if $data05 != 5.000000000 then return -1 endi -if $data06 != 6 then +if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi sql select * from $mt where tgcol9 = '4' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 4 then +if $data04 != 4 then return -1 endi -if $data05 != 5.000000000 then +if $data05 != 5.000000000 then return -1 endi -if $data06 != 6 then +if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi sql select * from $mt where tgcol10 = 5 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 4 then +if $data04 != 4 then return -1 endi -if $data05 != 5.000000000 then +if $data05 != 5.000000000 then return -1 endi -if $data06 != 6 then +if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi sql select * from $mt where tgcol11 = '6' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 4 then +if $data04 != 4 then return -1 endi -if $data05 != 5.000000000 then +if $data05 != 5.000000000 then return -1 endi -if $data06 != 6 then +if $data06 != 6 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/column.sim b/tests/script/tsim/tag/column.sim index cc692900ce625317ead828310117abdc65cce598..041bc0a117856551a40f09d8961a7ca3e0e7d9ec 100644 --- a/tests/script/tsim/tag/column.sim +++ b/tests/script/tsim/tag/column.sim @@ -31,7 +31,7 @@ sql create table $tb using $mt tags( 0, '0' ) $i = 1 $tb = $tbPrefix . $i -sql create table $tb using $mt tags( 1, '1' ) +sql create table $tb using $mt tags( 1, '1' ) $i = 2 $tb = $tbPrefix . $i @@ -66,26 +66,26 @@ sql insert into $tb values(now, '3', '3') print =============== step4 sql select * from $mt where tgcol2 = '1' -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== step5 sql select * from $mt -if $rows != 4 then +if $rows != 4 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/commit.sim b/tests/script/tsim/tag/commit.sim index cc63e1670014e907ca3a0a832b7a34d1630c311f..e4f839e613472ec319980c19ca47e790d668baf1 100644 --- a/tests/script/tsim/tag/commit.sim +++ b/tests/script/tsim/tag/commit.sim @@ -25,39 +25,39 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 int sql reset query cache -sql alter table $tb set tag tgcol4 =4 +sql alter table $tb set tag tgcol4 =4 sql reset query cache sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi @@ -71,61 +71,61 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 tinyint sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi sql select * from $mt where tgcol2 = 1 -x step3 return -1 step3: - + print =============== step4 $i = 4 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 2.00000 then @@ -133,34 +133,34 @@ if $data03 != 2.00000 then endi sql describe $tb -if $data21 != BIGINT then +if $data21 != BIGINT then return -1 endi -if $data31 != FLOAT then +if $data31 != FLOAT then return -1 endi -if $data23 != TAG then +if $data23 != TAG then return -1 endi -if $data33 != TAG then +if $data33 != TAG then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 float sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 4.00000 then @@ -170,184 +170,184 @@ endi sql select * from $mt where tgcol2 = 1 -x step4 return -1 step4: - + print =============== step5 $i = 5 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10)) sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = '2' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt add tag tgcol4 smallint sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql reset query cache sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi sql select * from $mt where tgcol3 = '1' -x step5 return -1 step5: - + print =============== step6 $i = 6 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 tinyint) sql create table $tb using $mt tags( 1, 2, 3 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql alter table $mt rename tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 binary(10) sql alter table $mt add tag tgcol6 binary(10) sql reset query cache -sql alter table $tb set tag tgcol4=false -sql alter table $tb set tag tgcol5='5' -sql alter table $tb set tag tgcol6='6' +sql alter table $tb set tag tgcol4=false +sql alter table $tb set tag tgcol5='5' +sql alter table $tb set tag tgcol6='6' sql reset query cache sql select * from $mt where tgcol5 = '5' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi -if $data04 != 6 then +if $data04 != 6 then return -1 endi sql select * from $mt where tgcol6 = '6' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi -if $data04 != 6 then +if $data04 != 6 then return -1 endi sql select * from $mt where tgcol4 = 1 -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where tgcol3 = 1 -x step52 return -1 step52: - + print =============== step7 $i = 7 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint, tgcol3 binary(10)) sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol3 = '3' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql alter table $mt rename tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 bigint sql alter table $mt add tag tgcol6 tinyint sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5=5 -sql alter table $tb set tag tgcol6=6 +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5=5 +sql alter table $tb set tag tgcol6=6 sql reset query cache sql select * from $mt where tgcol6 = 6 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 4 then +if $data02 != 4 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi -if $data04 != 6 then +if $data04 != 6 then return -1 endi @@ -357,54 +357,54 @@ step71: sql select * from $mt where tgcol3 = 1 -x step72 return -1 step72: - + print =============== step8 $i = 8 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float, tgcol3 binary(10)) sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol3 = '3' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 2.00000 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql alter table $mt rename tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 binary(17) sql alter table $mt add tag tgcol6 bool sql reset query cache -sql alter table $tb set tag tgcol4=4 -sql alter table $tb set tag tgcol5='5' +sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol5='5' sql alter table $tb set tag tgcol6=1 sql reset query cache sql select * from $mt where tgcol5 = '5' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 4 then +if $data02 != 4 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi if $data04 != 1 then @@ -424,45 +424,45 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10), tgcol3 binary(10)) sql create table $tb using $mt tags( 1, '2', '3' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = '2' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql alter table $mt rename tag tgcol1 tgcol4 -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt add tag tgcol5 bool sql alter table $mt add tag tgcol6 float sql reset query cache -sql alter table $tb set tag tgcol4=4 +sql alter table $tb set tag tgcol4=4 sql alter table $tb set tag tgcol5=1 sql alter table $tb set tag tgcol6=6 sql reset query cache sql select * from $mt where tgcol5 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 4.000000000 then +if $data02 != 4.000000000 then return -1 endi if $data03 != 1 then @@ -485,24 +485,24 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10)) sql create table $tb using $mt tags( '1', '2', '3', '4' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol4 = '4' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi @@ -510,7 +510,7 @@ sql alter table $mt rename tag tgcol1 tgcol4 -x step103 return -1 step103: -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt drop tag tgcol4 sql reset query cache @@ -524,22 +524,22 @@ sql reset query cache sql select * from $mt where tgcol4 = '4' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != null then return -1 endi @@ -556,27 +556,27 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 smallint, tgcol4 float, tgcol5 binary(10)) sql create table $tb using $mt tags( 1, 2, 3, 4, '5' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi if $data05 != 4.00000 then return -1 endi -if $data06 != 5 then +if $data06 != 5 then return -1 endi @@ -584,7 +584,7 @@ sql alter table $mt rename tag tgcol1 tgcol4 -x step114 return -1 step114: -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt drop tag tgcol4 sql alter table $mt drop tag tgcol5 @@ -596,7 +596,7 @@ sql alter table $mt add tag tgcol7 bigint sql alter table $mt add tag tgcol8 smallint sql reset query cache -sql alter table $tb set tag tgcol4='4' +sql alter table $tb set tag tgcol4='4' sql alter table $tb set tag tgcol5=5 sql alter table $tb set tag tgcol6='6' sql alter table $tb set tag tgcol7=7 @@ -605,28 +605,28 @@ sql reset query cache sql select * from $mt where tgcol5 =5 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi -if $data04 != 5 then +if $data04 != 5 then return -1 endi -if $data05 != 6 then +if $data05 != 6 then return -1 endi -if $data06 != 7 then +if $data06 != 7 then return -1 endi -if $data07 != 8 then +if $data07 != 8 then return -1 endi @@ -646,34 +646,34 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 smallint, tgcol3 float, tgcol4 double, tgcol5 binary(10), tgcol6 binary(20)) sql create table $tb using $mt tags( 1, 2, 3, 4, '5', '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi if $data04 != 3.00000 then return -1 endi -if $data05 != 4.000000000 then +if $data05 != 4.000000000 then return -1 endi -if $data06 != 5 then +if $data06 != 5 then return -1 endi -if $data07 != 6 then +if $data07 != 6 then return -1 endi -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 sql alter table $mt drop tag tgcol4 sql alter table $mt drop tag tgcol5 @@ -684,8 +684,8 @@ sql alter table $mt add tag tgcol4 binary(10) sql alter table $mt add tag tgcol5 bigint sql reset query cache -sql alter table $tb set tag tgcol1=false -sql alter table $tb set tag tgcol2='5' +sql alter table $tb set tag tgcol1=false +sql alter table $tb set tag tgcol2='5' sql alter table $tb set tag tgcol3=4 sql alter table $tb set tag tgcol4='3' sql alter table $tb set tag tgcol5=2 @@ -694,28 +694,28 @@ sql reset query cache sql select * from $mt where tgcol4 = '3' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 1 then +if $data03 != 1 then return -1 endi -if $data04 != 5 then +if $data04 != 5 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi -if $data06 != 3 then +if $data06 != 3 then return -1 endi -if $data07 != 2 then +if $data07 != 2 then return -1 endi @@ -745,34 +745,34 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20)) sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = '1' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi -if $data06 != 5.000000000 then +if $data06 != 5.000000000 then return -1 endi -if $data07 != 6 then +if $data07 != 6 then return -1 endi -sql alter table $mt drop tag tgcol2 +sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol4 sql alter table $mt drop tag tgcol6 sql reset query cache @@ -781,8 +781,8 @@ sql alter table $mt add tag tgcol4 int sql alter table $mt add tag tgcol6 bigint sql reset query cache -sql alter table $tb set tag tgcol1='7' -sql alter table $tb set tag tgcol2='8' +sql alter table $tb set tag tgcol1='7' +sql alter table $tb set tag tgcol2='8' sql alter table $tb set tag tgcol3=9 sql alter table $tb set tag tgcol4=10 sql alter table $tb set tag tgcol5=11 @@ -791,28 +791,28 @@ sql reset query cache sql select * from $mt where tgcol2 = '8' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 7 then +if $data02 != 7 then return -1 endi -if $data03 != 9 then +if $data03 != 9 then return -1 endi -if $data04 != 11.000000000 then +if $data04 != 11.000000000 then return -1 endi -if $data05 != 8 then +if $data05 != 8 then return -1 endi -if $data06 != 10 then +if $data06 != 10 then return -1 endi -if $data07 != 12 then +if $data07 != 12 then return -1 endi @@ -832,16 +832,16 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi @@ -852,19 +852,19 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi - + print =============== step4 $i = 4 $mt = $mtPrefix . $i @@ -872,20 +872,20 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 4.00000 then return -1 endi - + print =============== step5 $i = 5 $mt = $mtPrefix . $i @@ -893,20 +893,20 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi - + print =============== step6 $i = 6 $mt = $mtPrefix . $i @@ -914,45 +914,45 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol5 = '5' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi -if $data04 != 6 then +if $data04 != 6 then return -1 endi sql select * from $mt where tgcol6 = '6' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi -if $data04 != 6 then +if $data04 != 6 then return -1 endi sql select * from $mt where tgcol4 = 1 -if $rows != 0 then +if $rows != 0 then return -1 endi - + print =============== step7 $i = 7 $mt = $mtPrefix . $i @@ -960,23 +960,23 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol6 = 6 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 4 then +if $data02 != 4 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi -if $data04 != 6 then +if $data04 != 6 then return -1 endi - + print =============== step8 $i = 8 $mt = $mtPrefix . $i @@ -984,16 +984,16 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol5 = '5' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 4 then +if $data02 != 4 then return -1 endi -if $data03 != 5 then +if $data03 != 5 then return -1 endi if $data04 != 1 then @@ -1008,13 +1008,13 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol5 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 4.000000000 then +if $data02 != 4.000000000 then return -1 endi if $data03 != 1 then @@ -1032,22 +1032,22 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol4 = '4' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi if $data04 != 0 then return -1 endi -if $data05 != null then +if $data05 != null then return -1 endi @@ -1058,28 +1058,28 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol5 =5 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi -if $data04 != 5 then +if $data04 != 5 then return -1 endi -if $data05 != 6 then +if $data05 != 6 then return -1 endi -if $data06 != 7 then +if $data06 != 7 then return -1 endi -if $data07 != 8 then +if $data07 != 8 then return -1 endi @@ -1091,28 +1091,28 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol4 = '3' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 1 then +if $data03 != 1 then return -1 endi -if $data04 != 5 then +if $data04 != 5 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi -if $data06 != 3 then +if $data06 != 3 then return -1 endi -if $data07 != 2 then +if $data07 != 2 then return -1 endi @@ -1143,36 +1143,36 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol2 = '8' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 7 then +if $data02 != 7 then return -1 endi -if $data03 != 9 then +if $data03 != 9 then return -1 endi -if $data04 != 11.000000000 then +if $data04 != 11.000000000 then return -1 endi -if $data05 != 8 then +if $data05 != 8 then return -1 endi -if $data06 != 10 then +if $data06 != 10 then return -1 endi -if $data07 != 12 then +if $data07 != 12 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/create.sim b/tests/script/tsim/tag/create.sim index da683389cb5b30f3f0d8ff520fb5b92ecddf63d8..1db2251da03891031f082322afb2f2d4628ae959 100644 --- a/tests/script/tsim/tag/create.sim +++ b/tests/script/tsim/tag/create.sim @@ -25,107 +25,107 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool) sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi - + print =============== step3 $i = 3 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol smallint) sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi - + print =============== step4 $i = 4 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol tinyint) sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi - + print =============== step5 $i = 5 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi - + print =============== step6 $i = 6 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bigint) sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi - + print =============== step7 $i = 7 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol float) sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = 0 @@ -133,62 +133,62 @@ if $rows != 0 then print expect 0, actual: $rows return -1 endi - + print =============== step8 $i = 8 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol double) sql create table $tb using $mt tags( 1 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi - + print =============== step9 $i = 9 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(10)) sql create table $tb using $mt tags( '1') -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = '1' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol = '0' -if $rows != 0 then +if $rows != 0 then return -1 endi - + print =============== step10 $i = 10 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 bool) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 1 if $rows != 1 then print expect 1, actual: $rows return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -198,16 +198,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 smallint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -217,16 +217,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 tinyint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -236,16 +236,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 int) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -255,17 +255,17 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 bigint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi print =============== step15 @@ -274,16 +274,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 float) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -293,16 +293,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 double) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -312,16 +312,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 binary(10)) sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = true -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -331,16 +331,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol smallint, tgcol2 tinyint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -350,16 +350,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol tinyint, tgcol2 int) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -369,16 +369,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int, tgcol2 bigint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -388,16 +388,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bigint, tgcol2 float) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -407,16 +407,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol float, tgcol2 double) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -426,16 +426,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol double, tgcol2 binary(10)) sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = '2' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -445,51 +445,51 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 bool, tgcol3 int, tgcol4 float, tgcol5 double, tgcol6 binary(10)) sql create table $tb using $mt tags( 1, 2, 3, 4, 5, '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol2 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol3 = 3 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol4 = 4 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol5 = 5 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol6 = '6' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol6 = '0' -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -499,16 +499,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol bool, tgcol2 int, tgcol3 float, tgcol4 double, tgcol5 binary(10), tgcol6 binary(10)) sql create table $tb using $mt tags( 1, 2, 3, 4, '5', '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol6 = '6' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol6 = '0' -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -518,16 +518,16 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10), tgcol5 binary(10), tgcol6 binary(10)) sql create table $tb using $mt tags( '1', '2', '3', '4', '5', '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol3 = '3' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi sql select * from $mt where tgcol3 = '0' -if $rows != 0 then +if $rows != 0 then return -1 endi @@ -545,12 +545,12 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(250), tgcol2 binary(250)) sql create table $tb using $mt tags('1', '1') -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = '1' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi @@ -560,12 +560,12 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(25), tgcol2 binary(250)) sql create table $tb using $mt tags('1', '1') -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol = '1' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi @@ -575,7 +575,7 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(250), tgcol2 binary(250), tgcol3 binary(30)) -x step30 # return -1 -step30: +step30: print =============== step31 $i = 31 @@ -584,16 +584,16 @@ $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(5)) sql_error create table $tb using $mt tags('1234567') sql create table $tb using $mt tags('12345') -sql insert into $tb values(now, 1) -sql select * from $mt +sql insert into $tb values(now, 1) +sql select * from $mt print sql select * from $mt -if $rows != 1 then +if $rows != 1 then return -1 endi print $data00 $data01 $data02 -if $data02 != 12345 then +if $data02 != 12345 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/delete.sim b/tests/script/tsim/tag/delete.sim index 36ef1110f8093228f1643b15547d4f96b67ea787..acf99cc874c90170c53a393ae511c340a77d18fc 100644 --- a/tests/script/tsim/tag/delete.sim +++ b/tests/script/tsim/tag/delete.sim @@ -25,18 +25,18 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi @@ -48,38 +48,38 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi sql alter table $mt drop tag tgcol2 - + print =============== step4 $i = 4 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 < 3 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 2.00000 then @@ -87,13 +87,13 @@ if $data03 != 2.00000 then endi sql describe $tb -if $data21 != BIGINT then +if $data21 != BIGINT then return -1 endi -if $data31 != FLOAT then +if $data31 != FLOAT then return -1 endi -if $data23 != TAG then +if $data23 != TAG then return -1 endi @@ -101,25 +101,25 @@ sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol1 -x step40 return -1 step40: - + print =============== step5 $i = 5 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10)) sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = '2' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi @@ -127,111 +127,111 @@ sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol1 -x step50 return -1 step50: - + print =============== step6 $i = 6 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 tinyint) sql create table $tb using $mt tags( 1, 2, 3 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 - + print =============== step7 $i = 7 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint, tgcol3 binary(10)) sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol3 = '3' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi sql describe $tb -if $data21 != SMALLINT then +if $data21 != SMALLINT then return -1 endi -if $data31 != TINYINT then +if $data31 != TINYINT then return -1 endi -if $data41 != VARCHAR then +if $data41 != VARCHAR then return -1 endi -if $data22 != 2 then +if $data22 != 2 then return -1 endi -if $data32 != 1 then +if $data32 != 1 then return -1 endi -if $data42 != 10 then +if $data42 != 10 then return -1 endi -if $data23 != TAG then +if $data23 != TAG then return -1 endi -if $data33 != TAG then +if $data33 != TAG then return -1 endi -if $data43 != TAG then +if $data43 != TAG then return -1 endi sql alter table $mt drop tag tgcol2 sql alter table $mt drop tag tgcol3 - + print =============== step8 $i = 8 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float, tgcol3 binary(10)) sql create table $tb using $mt tags( 1, 2, '3' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol3 = '3' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi if $data03 != 2.00000 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi @@ -244,21 +244,21 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10), tgcol3 binary(10)) sql create table $tb using $mt tags( 1, '2', '3' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = 2 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi @@ -271,24 +271,24 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 binary(10), tgcol3 binary(10), tgcol4 binary(10)) sql create table $tb using $mt tags( '1', '2', '3', '4' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol4 = '4' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi @@ -302,27 +302,27 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int, tgcol3 smallint, tgcol4 float, tgcol5 binary(10)) sql create table $tb using $mt tags( 1, 2, 3, 4, '5' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi if $data05 != 4.00000 then return -1 endi -if $data06 != 5 then +if $data06 != 5 then return -1 endi @@ -336,30 +336,30 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 smallint, tgcol3 float, tgcol4 double, tgcol5 binary(10), tgcol6 binary(20)) sql create table $tb using $mt tags( 1, 2, 3, 4, '5', '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi if $data04 != 3.00000 then return -1 endi -if $data05 != 4.000000000 then +if $data05 != 4.000000000 then return -1 endi -if $data06 != 5 then +if $data06 != 5 then return -1 endi -if $data07 != 6 then +if $data07 != 6 then return -1 endi @@ -374,30 +374,30 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20)) sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = '1' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi -if $data06 != 5.000000000 then +if $data06 != 5.000000000 then return -1 endi -if $data07 != 6 then +if $data07 != 6 then return -1 endi @@ -412,16 +412,16 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol1 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != null then return -1 endi @@ -436,23 +436,23 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol1 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != null then return -1 endi sql select * from $mt where tgcol2 = 1 -x step3 return -1 step3: - + print =============== step4 $i = 4 $mt = $mtPrefix . $i @@ -460,23 +460,23 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol1 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != null then return -1 endi sql select * from $mt where tgcol2 = 1 -x step4 return -1 step4: - + print =============== step5 $i = 5 $mt = $mtPrefix . $i @@ -484,23 +484,23 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol1 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != null then return -1 endi sql select * from $mt where tgcol2 = '1' -x step5 return -1 step5: - + print =============== step6 $i = 6 $mt = $mtPrefix . $i @@ -508,19 +508,19 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol1 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != null then return -1 endi -if $data04 != null then +if $data04 != null then return -1 endi @@ -530,7 +530,7 @@ step51: sql select * from $mt where tgcol3 = 1 -x step52 return -1 step52: - + print =============== step7 $i = 7 $mt = $mtPrefix . $i @@ -538,19 +538,19 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol1 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != null then return -1 endi -if $data04 != null then +if $data04 != null then return -1 endi @@ -560,7 +560,7 @@ step71: sql select * from $mt where tgcol3 = 1 -x step72 return -1 step72: - + print =============== step8 $i = 8 $mt = $mtPrefix . $i @@ -568,19 +568,19 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol1 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != null then return -1 endi -if $data04 != null then +if $data04 != null then return -1 endi @@ -598,19 +598,19 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol1 = 1 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != null then +if $data03 != null then return -1 endi -if $data04 != null then +if $data04 != null then return -1 endi @@ -628,22 +628,22 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol1 = '1' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != null then +if $data03 != null then return -1 endi -if $data04 != null then +if $data04 != null then return -1 endi -if $data05 != null then +if $data05 != null then return -1 endi @@ -664,10 +664,10 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol4=4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then @@ -676,13 +676,13 @@ endi if $data03 != 4.00000 then return -1 endi -if $data04 != null then +if $data04 != null then return -1 endi -if $data05 != null then +if $data05 != null then return -1 endi -if $data06 != null then +if $data06 != null then return -1 endi @@ -703,28 +703,28 @@ $tb = $tbPrefix . $i sql select * from $mt where tgcol4 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 4.000000000 then +if $data03 != 4.000000000 then return -1 endi -if $data04 != null then +if $data04 != null then return -1 endi -if $data05 != null then +if $data05 != null then return -1 endi -if $data06 != null then +if $data06 != null then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi @@ -749,28 +749,28 @@ $tb = $tbPrefix . $i sql reset query cache sql select * from $mt where tgcol2 = 2 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 5.000000000 then +if $data04 != 5.000000000 then return -1 endi -if $data05 != null then +if $data05 != null then return -1 endi -if $data06 != null then +if $data06 != null then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi @@ -790,7 +790,7 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 bigint) sql create table $tb using $mt tags( 1, 1 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql alter table xxmt drop tag tag1 -x step141 return -1 @@ -814,8 +814,8 @@ step145: print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/double.sim b/tests/script/tsim/tag/double.sim index 7af2f19c597b6acc1860a9d9f11b14a64a3ebfda..fbdf9733370b19eb2506801aaf61490e05ae6ed0 100644 --- a/tests/script/tsim/tag/double.sim +++ b/tests/script/tsim/tag/double.sim @@ -24,50 +24,50 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol double) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) + sql create table $tb using $mt tags( 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) + sql create table $tb using $mt tags( 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $tb -if $rows != $rowNum then +if $rows != $rowNum then return -1 endi sql select * from $tb where ts < now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts <= now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts > now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts >= now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then +if $rows != 1 then return -1 endi sql select * from $tb where ts < now + 4m and ts > now + 5m @@ -83,156 +83,156 @@ if $rows != 0 then return -1 endi sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== step3 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step4 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step7 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/filter.sim b/tests/script/tsim/tag/filter.sim index 9fb5f66c36e5c36ef94b3320306cf71de4958d4e..4f116cb58d1f8d2f35fbf9b7a4f58e18525fb9cc 100644 --- a/tests/script/tsim/tag/filter.sim +++ b/tests/script/tsim/tag/filter.sim @@ -24,31 +24,31 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol binary(10)) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '0' ) + sql create table $tb using $mt tags( '0' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( '1' ) + sql create table $tb using $mt tags( '1' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = '1' +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi @@ -62,18 +62,18 @@ sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(t step3: print =============== step4 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' -if $rows != 1 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' +if $rows != 1 then return -1 endi -if $data00 != 10 then +if $data00 != 10 then return -1 endi print =============== step5 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi @@ -96,9 +96,9 @@ sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(t step9: print =============== step10 -sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi @@ -112,14 +112,14 @@ step12: print =============== step13 sql select count(tbcol) as c from $mt group by tgcol -print $data00 -if $data00 != 100 then +print $data00 +if $data00 != 100 then return -1 endi print =============== step14 sql select count(tbcol) as c from $mt where ts > 1000 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 if $data00 != 100 then print expect 100, actual $data00 return -1 @@ -132,16 +132,16 @@ step15: print =============== step16 sql select count(tbcol) as c from $mt where tgcol = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/float.sim b/tests/script/tsim/tag/float.sim index d1761883292c91a3e3264cb35238da896bd4239f..10fac93d5d547fb2232a26abb9c68e5baa5cd77a 100644 --- a/tests/script/tsim/tag/float.sim +++ b/tests/script/tsim/tag/float.sim @@ -24,50 +24,50 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol float) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) + sql create table $tb using $mt tags( 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) + sql create table $tb using $mt tags( 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $tb -if $rows != $rowNum then +if $rows != $rowNum then return -1 endi sql select * from $tb where ts < now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts <= now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts > now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts >= now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then +if $rows != 1 then return -1 endi sql select * from $tb where ts < now + 4m and ts > now + 5m @@ -83,156 +83,156 @@ if $rows != 0 then return -1 endi sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== step3 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step4 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step7 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/int.sim b/tests/script/tsim/tag/int.sim index 5a35695cbe31546629bc6d10b558fc4a0ca2d376..ac8d31db3bb181489311c9bec7b31abf1a39b305 100644 --- a/tests/script/tsim/tag/int.sim +++ b/tests/script/tsim/tag/int.sim @@ -24,50 +24,50 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) + sql create table $tb using $mt tags( 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) + sql create table $tb using $mt tags( 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $tb -if $rows != $rowNum then +if $rows != $rowNum then return -1 endi sql select * from $tb where ts < now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts <= now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts > now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts >= now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then +if $rows != 1 then return -1 endi sql select * from $tb where ts < now + 4m and ts > now + 5m @@ -78,160 +78,160 @@ sql select * from $tb where ts > 100000 and ts < 100000 if $rows != 0 then return -1 endi -sql select * from $tb where ts > now + 4m and ts < now + 3m +sql select * from $tb where ts > now + 4m and ts < now + 3m if $rows != 0 then return -1 endi sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== step3 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step4 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step7 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/int_binary.sim b/tests/script/tsim/tag/int_binary.sim index 53058ee331b26ac7eef46d8ed2272ae90dcc686e..83a830f64a53a458dcda87209e91cab3e0d0f18f 100644 --- a/tests/script/tsim/tag/int_binary.sim +++ b/tests/script/tsim/tag/int_binary.sim @@ -24,283 +24,283 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int, tgcol2 binary(5)) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, '0' ) + sql create table $tb using $mt tags( 0, '0' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, '1' ) + sql create table $tb using $mt tags( 1, '1' ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step3 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step4 sql select * from $mt where tgcol2 = '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> '0' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = '1' -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> '1' -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select * from $mt where ts > now + 4m and tgcol2 = '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '1' -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step7 sql select * from $mt where ts > now + 4m and tgcol2 = '1' and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = '0' and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> '0' and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and ts < now + 5m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 and tgcol2 = '1' -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 and tgcol2 = '1' group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step13 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step14 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/int_float.sim b/tests/script/tsim/tag/int_float.sim index 826e1f5c084b8689f481185219e1c4ccc0c59673..009629aac97fbfb0c7dc9fe26acb848ea0ec3a49 100644 --- a/tests/script/tsim/tag/int_float.sim +++ b/tests/script/tsim/tag/int_float.sim @@ -24,299 +24,299 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int, tgcol2 float) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0, 0 ) + sql create table $tb using $mt tags( 0, 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1, 1 ) + sql create table $tb using $mt tags( 1, 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step3 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step4 sql select * from $mt where tgcol2 > 0.5 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 < 0.5 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 > 0.5 and tgcol2 < 1.5 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol2 <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select * from $mt where ts > now + 4m and tgcol2 = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step7 sql select * from $mt where ts > now + 4m and tgcol2 = 1 and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 = 0 and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 and tgcol2 = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 and tgcol2 = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step13 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step14 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/set.sim b/tests/script/tsim/tag/set.sim index ebca50a3be13311fa46672012d26d30385d2ec4a..c66ae65903b324b823f1572d42c3e3aabd7bf30b 100644 --- a/tests/script/tsim/tag/set.sim +++ b/tests/script/tsim/tag/set.sim @@ -25,18 +25,18 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bool, tgcol2 int) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi @@ -50,46 +50,46 @@ sql reset query cache sql select * from $mt where tgcol1 = false print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi sql select * from $mt where tgcol2 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi if $data02 != 0 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi sql describe $tb print $data21 $data23 $data32 $data33 -if $data21 != BOOL then +if $data21 != BOOL then return -1 endi -if $data31 != INT then +if $data31 != INT then return -1 endi if $data23 != TAG then return -1 endi -if $data33 != TAG then +if $data33 != TAG then return -1 endi @@ -99,18 +99,18 @@ $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 smallint, tgcol2 tinyint) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi @@ -121,58 +121,58 @@ sql reset query cache sql select * from $mt where tgcol1 = 3 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 3 then +if $data02 != 3 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi sql select * from $mt where tgcol2 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 3 then +if $data02 != 3 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi sql select * from $mt where tgcol2 = 2 -if $rows != 0 then +if $rows != 0 then return -1 endi - - + + print =============== step4 $i = 4 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 bigint, tgcol2 float) sql create table $tb using $mt tags( 1, 2 ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = 1 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2.00000 then +if $data03 != 2.00000 then return -1 endi @@ -183,53 +183,53 @@ sql reset query cache sql select * from $mt where tgcol1 = 3 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 3 then +if $data02 != 3 then return -1 endi -if $data03 != 4.00000 then +if $data03 != 4.00000 then return -1 endi sql select * from $mt where tgcol2 = 4 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 3 then +if $data02 != 3 then return -1 endi -if $data03 != 4.00000 then +if $data03 != 4.00000 then return -1 endi - - + + print =============== step5 $i = 5 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 double, tgcol2 binary(10)) sql create table $tb using $mt tags( 1, '2' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol2 = '2' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1.000000000 then +if $data02 != 1.000000000 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi @@ -240,64 +240,64 @@ sql reset query cache sql select * from $mt where tgcol1 = 3 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 3.000000000 then +if $data02 != 3.000000000 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi sql select * from $mt where tgcol2 = '4' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 3.000000000 then +if $data02 != 3.000000000 then return -1 endi -if $data03 != 4 then +if $data03 != 4 then return -1 endi - + print =============== step6 $i = 6 $mt = $mtPrefix . $i $tb = $tbPrefix . $i sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol1 binary(10), tgcol2 int, tgcol3 smallint, tgcol4 binary(11), tgcol5 double, tgcol6 binary(20)) sql create table $tb using $mt tags( '1', 2, 3, '4', 5, '6' ) -sql insert into $tb values(now, 1) +sql insert into $tb values(now, 1) sql select * from $mt where tgcol1 = '1' -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 1 then +if $data02 != 1 then return -1 endi -if $data03 != 2 then +if $data03 != 2 then return -1 endi -if $data04 != 3 then +if $data04 != 3 then return -1 endi -if $data05 != 4 then +if $data05 != 4 then return -1 endi -if $data06 != 5.000000000 then +if $data06 != 5.000000000 then return -1 endi -if $data07 != 6 then +if $data07 != 6 then return -1 endi @@ -309,146 +309,146 @@ sql alter table $tb set tag tgcol5=10 sql alter table $tb set tag tgcol6='11' sql reset query cache - + sql select * from $mt where tgcol1 = '7' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 7 then +if $data02 != 7 then return -1 endi -if $data03 != 8 then +if $data03 != 8 then return -1 endi -if $data04 != 9 then +if $data04 != 9 then return -1 endi -if $data05 != 10.000000000 then +if $data05 != 10.000000000 then return -1 endi -if $data06 != 11 then +if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi sql select * from $mt where tgcol2 = 8 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 7 then +if $data02 != 7 then return -1 endi -if $data03 != 8 then +if $data03 != 8 then return -1 endi -if $data04 != 9 then +if $data04 != 9 then return -1 endi -if $data05 != 10.000000000 then +if $data05 != 10.000000000 then return -1 endi -if $data06 != 11 then +if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi sql select * from $mt where tgcol4 = '9' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 7 then +if $data02 != 7 then return -1 endi -if $data03 != 8 then +if $data03 != 8 then return -1 endi -if $data04 != 9 then +if $data04 != 9 then return -1 endi -if $data05 != 10.000000000 then +if $data05 != 10.000000000 then return -1 endi -if $data06 != 11 then +if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi sql select * from $mt where tgcol5 = 10 print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 7 then +if $data02 != 7 then return -1 endi -if $data03 != 8 then +if $data03 != 8 then return -1 endi -if $data04 != 9 then +if $data04 != 9 then return -1 endi -if $data05 != 10.000000000 then +if $data05 != 10.000000000 then return -1 endi -if $data06 != 11 then +if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi sql select * from $mt where tgcol6 = '11' print $data01 $data02 $data03 -if $rows != 1 then +if $rows != 1 then return -1 endi -if $data01 != 1 then +if $data01 != 1 then return -1 endi -if $data02 != 7 then +if $data02 != 7 then return -1 endi -if $data03 != 8 then +if $data03 != 8 then return -1 endi -if $data04 != 9 then +if $data04 != 9 then return -1 endi -if $data05 != 10.000000000 then +if $data05 != 10.000000000 then return -1 endi -if $data06 != 11 then +if $data06 != 11 then return -1 endi -if $data07 != null then +if $data07 != null then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi diff --git a/tests/script/tsim/tag/smallint.sim b/tests/script/tsim/tag/smallint.sim index 9fb3ca142646f2ea4de7c7892f2e38987d155596..e3a819c837761a2ffddbc8d3cfb7f77c2d785d06 100644 --- a/tests/script/tsim/tag/smallint.sim +++ b/tests/script/tsim/tag/smallint.sim @@ -24,214 +24,214 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol smallint) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) + sql create table $tb using $mt tags( 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) + sql create table $tb using $mt tags( 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $tb -if $rows != $rowNum then +if $rows != $rowNum then return -1 endi sql select * from $tb where ts < now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts <= now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts > now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts >= now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then +if $rows != 1 then return -1 endi sql select * from $tb where ts < now + 4m and ts > now + 5m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $tb where ts > 100000 and ts < 100000 -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $tb where ts > now + 4m and ts < now + 3m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== step3 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step4 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step7 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT diff --git a/tests/script/tsim/tag/tinyint.sim b/tests/script/tsim/tag/tinyint.sim index 11cd6ee3b2b8ec5e5defbc65e4abed6fe0fc32c7..8560def34cc22cc73a592ac062d5bb8f9867b8c0 100644 --- a/tests/script/tsim/tag/tinyint.sim +++ b/tests/script/tsim/tag/tinyint.sim @@ -24,214 +24,214 @@ sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol tinyint) $i = 0 while $i < 5 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 0 ) + sql create table $tb using $mt tags( 0 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw while $i < 10 $tb = $tbPrefix . $i - sql create table $tb using $mt tags( 1 ) + sql create table $tb using $mt tags( 1 ) $x = 0 while $x < $rowNum - $ms = $x . m - sql insert into $tb values (now + $ms , $x ) + $ms = $x . m + sql insert into $tb values (now + $ms , $x ) $x = $x + 1 - endw + endw $i = $i + 1 -endw +endw print =============== step2 sql select * from $tb -if $rows != $rowNum then +if $rows != $rowNum then return -1 endi sql select * from $tb where ts < now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts <= now + 4m -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $tb where ts > now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts >= now + 4m -if $rows != 15 then +if $rows != 15 then return -1 endi sql select * from $tb where ts > now + 4m and ts < now + 5m -if $rows != 1 then +if $rows != 1 then return -1 endi sql select * from $tb where ts < now + 4m and ts > now + 5m if $rows != 0 then return -1 endi -sql select * from $tb where ts > 100000 and ts < 100000 +sql select * from $tb where ts > 100000 and ts < 100000 if $rows != 0 then return -1 endi -sql select * from $tb where ts > now + 4m and ts < now + 3m +sql select * from $tb where ts > now + 4m and ts < now + 3m if $rows != 0 then return -1 endi sql select * from $tb where ts > now + 4m and ts > now + 5m and ts < now + 6m -if $rows != 1 then +if $rows != 1 then return -1 endi print =============== step3 sql select * from $mt -if $rows != $totalNum then +if $rows != $totalNum then return -1 endi sql select * from $mt where ts < now + 4m -if $rows != 50 then +if $rows != 50 then return -1 endi sql select * from $mt where ts > now + 4m -if $rows != 150 then +if $rows != 150 then return -1 endi sql select * from $mt where ts = now + 4m -if $rows != 0 then +if $rows != 0 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m -if $rows != 10 then +if $rows != 10 then return -1 endi print =============== step4 sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 1 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol = 0 -if $rows != 100 then +if $rows != 100 then return -1 endi sql select * from $mt where tgcol <> 0 -if $rows != 100 then +if $rows != 100 then return -1 endi print =============== step5 sql select * from $mt where ts > now + 4m and tgcol = 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 1 -if $rows != 75 then +if $rows != 75 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts < now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol = 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts <= now + 4m and tgcol <> 0 -if $rows != 25 then +if $rows != 25 then return -1 endi sql select * from $mt where ts > now + 4m and ts < now + 5m and tgcol <> 0 -if $rows != 5 then +if $rows != 5 then return -1 endi sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts < now + 5m -if $rows != 5 then +if $rows != 5 then return -1 endi print =============== step6 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 200 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 200 then return -1 endi print =============== step7 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step8 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 50 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 50 then return -1 endi print =============== step9 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step10 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tgcol = 1 group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== step11 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m group by tgcol -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 25 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 25 then return -1 endi print =============== step12 sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt partition by tgcol interval(1d) -print $data00 $data01 $data02 $data03 $data04 $data05 $data06 -if $data00 != 100 then +print $data00 $data01 $data02 $data03 $data04 $data05 $data06 +if $data00 != 100 then return -1 endi print =============== clear sql drop database $db sql select * from information_schema.ins_databases -if $rows != 2 then +if $rows != 2 then return -1 endi -system sh/exec.sh -n dnode1 -s stop -x SIGINT \ No newline at end of file +system sh/exec.sh -n dnode1 -s stop -x SIGINT