fix(query): fix test cases
This commit is contained in:
parent
3e9609e240
commit
fb00a50b9f
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -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
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
Loading…
Reference in New Issue