fix(query): fix test cases

This commit is contained in:
Ganlin Zhao 2022-08-15 14:10:07 +08:00
parent f8f0d08c2e
commit 6a04b8be09
18 changed files with 577 additions and 577 deletions

View File

@ -8,9 +8,9 @@ print =============== create database
sql create database `database` sql create database `database`
sql create database `DataBase` sql create database `DataBase`
sql select * from information_schema.ins_databases sql select * from information_schema.ins_databases
print rows: $rows print rows: $rows
print $data00 $data01 print $data00 $data01
print $data10 $data11 print $data10 $data11
print $data20 $data21 print $data20 $data21
if $rows != 4 then if $rows != 4 then
return -1 return -1
@ -27,12 +27,12 @@ endi
$dbCnt = 0 $dbCnt = 0
while $dbCnt < 2 while $dbCnt < 2
if $dbCnt == 0 then if $dbCnt == 0 then
sql use `database` sql use `database`
else else
sql use `DataBase` sql use `DataBase`
endi endi
$dbCnt = $dbCnt + 1 $dbCnt = $dbCnt + 1
print =============== create super table, include all type print =============== create super table, include all type
@ -41,13 +41,13 @@ while $dbCnt < 2
sql create table `Stable` (`timestamp` timestamp, `int` int, `Binary` binary(32), `Nchar` nchar(32)) tags (`float` float, `binary` binary(16), `nchar` nchar(16)) sql create table `Stable` (`timestamp` timestamp, `int` int, `Binary` binary(32), `Nchar` nchar(32)) tags (`float` float, `binary` binary(16), `nchar` nchar(16))
sql show stables sql show stables
print rows: $rows print rows: $rows
print $data00 $data01 print $data00 $data01
print $data10 $data11 print $data10 $data11
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $data00 != Stable then if $data00 != Stable then
if $data00 != stable then if $data00 != stable then
return -1 return -1
endi endi
@ -57,24 +57,24 @@ while $dbCnt < 2
return -1 return -1
endi endi
endi endi
print =============== create child table print =============== create child table
sql create table `table` using `stable` tags(100.0, 'stable+table', 'stable+table') sql create table `table` using `stable` tags(100.0, 'stable+table', 'stable+table')
sql create table `Table` using `stable` tags(100.1, 'stable+Table', 'stable+Table') sql create table `Table` using `stable` tags(100.1, 'stable+Table', 'stable+Table')
sql create table `TAble` using `Stable` tags(100.0, 'Stable+TAble', 'Stable+TAble') sql create table `TAble` using `Stable` tags(100.0, 'Stable+TAble', 'Stable+TAble')
sql create table `TABle` using `Stable` tags(100.1, 'Stable+TABle', 'Stable+TABle') sql create table `TABle` using `Stable` tags(100.1, 'Stable+TABle', 'Stable+TABle')
sql show tables sql show tables
print rows: $rows print rows: $rows
print $data00 $data01 print $data00 $data01
print $data10 $data11 print $data10 $data11
print $data20 $data21 print $data20 $data21
print $data30 $data31 print $data30 $data31
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
print =============== insert data print =============== insert data
sql insert into `table` values(now+0s, 10, 'table', 'table')(now+1s, 11, 'table', 'table') sql insert into `table` values(now+0s, 10, 'table', 'table')(now+1s, 11, 'table', 'table')
sql insert into `Table` values(now+0s, 20, 'Table', 'Table')(now+1s, 21, 'Table', 'Table') sql insert into `Table` values(now+0s, 20, 'Table', 'Table')(now+1s, 21, 'Table', 'Table')
@ -86,15 +86,15 @@ while $dbCnt < 2
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $data01 != 10 then if $data01 != 10 then
return -1 return -1
endi endi
if $data02 != table then if $data02 != table then
return -1 return -1
endi endi
if $data03 != table then if $data03 != table then
print expect table, actual $data03 print expect table, actual $data03
return -1 return -1
@ -103,57 +103,57 @@ while $dbCnt < 2
print =================> 1 print =================> 1
sql select * from `Table` sql select * from `Table`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $data01 != 20 then if $data01 != 20 then
return -1 return -1
endi endi
if $data02 != Table then if $data02 != Table then
return -1 return -1
endi endi
if $data03 != Table then if $data03 != Table then
return -1 return -1
endi endi
print ================>2 print ================>2
sql select * from `TAble` sql select * from `TAble`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
if $rows != 2 then if $rows != 2 then
return -1
endi
if $data01 != 30 then
return -1
endi
if $data02 != TAble then
return -1
endi
if $data03 != TAble then
return -1 return -1
endi endi
if $data01 != 30 then
return -1
endi
if $data02 != TAble then
return -1
endi
if $data03 != TAble then
return -1
endi
sql select * from `TABle` sql select * from `TABle`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
if $rows != 2 then if $rows != 2 then
return -1
endi
if $data01 != 40 then
return -1
endi
if $data02 != TABle then
return -1
endi
if $data03 != TABle then
return -1 return -1
endi endi
if $data01 != 40 then
return -1
endi
if $data02 != TABle then
return -1
endi
if $data03 != TABle then
return -1
endi
#print =============== query data from st, but not support select * from super table, waiting fix #print =============== query data from st, but not support select * from super table, waiting fix
#sql select count(*) from `stable` #sql select count(*) from `stable`
#print rows: $rows #print rows: $rows
@ -174,7 +174,7 @@ while $dbCnt < 2
# return -1 # return -1
#endi #endi
#sql select * from `stable` #sql select * from `stable`
#if $rows != 4 then #if $rows != 4 then
# return -1 # return -1
#endi #endi
@ -185,9 +185,9 @@ system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sql select * from information_schema.ins_databases sql select * from information_schema.ins_databases
print rows: $rows print rows: $rows
print $data00 $data01 print $data00 $data01
print $data10 $data11 print $data10 $data11
print $data20 $data21 print $data20 $data21
if $rows != 4 then if $rows != 4 then
return -1 return -1
@ -204,22 +204,22 @@ endi
$dbCnt = 0 $dbCnt = 0
while $dbCnt < 2 while $dbCnt < 2
if $dbCnt == 0 then if $dbCnt == 0 then
sql use `database` sql use `database`
else else
sql use `DataBase` sql use `DataBase`
endi endi
$dbCnt = $dbCnt + 1 $dbCnt = $dbCnt + 1
sql show stables sql show stables
print rows: $rows print rows: $rows
print $data00 $data01 print $data00 $data01
print $data10 $data11 print $data10 $data11
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
if $data00 != Stable then if $data00 != Stable then
if $data00 != stable then if $data00 != stable then
return -1 return -1
endi endi
@ -229,86 +229,86 @@ while $dbCnt < 2
return -1 return -1
endi endi
endi endi
sql show tables sql show tables
print rows: $rows print rows: $rows
print $data00 $data01 print $data00 $data01
print $data10 $data11 print $data10 $data11
print $data20 $data21 print $data20 $data21
print $data30 $data31 print $data30 $data31
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
print =============== query data print =============== query data
sql select * from `table` sql select * from `table`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
if $rows != 2 then if $rows != 2 then
return -1
endi
if $data01 != 10 then
return -1
endi
if $data02 != table then
return -1
endi
if $data03 != table then
return -1 return -1
endi endi
if $data01 != 10 then
return -1
endi
if $data02 != table then
return -1
endi
if $data03 != table then
return -1
endi
sql select * from `Table` sql select * from `Table`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
if $rows != 2 then if $rows != 2 then
return -1
endi
if $data01 != 20 then
return -1
endi
if $data02 != Table then
return -1
endi
if $data03 != Table then
return -1 return -1
endi endi
if $data01 != 20 then
return -1
endi
if $data02 != Table then
return -1
endi
if $data03 != Table then
return -1
endi
sql select * from `TAble` sql select * from `TAble`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
if $rows != 2 then if $rows != 2 then
return -1
endi
if $data01 != 30 then
return -1
endi
if $data02 != TAble then
return -1
endi
if $data03 != TAble then
return -1 return -1
endi endi
if $data01 != 30 then
return -1
endi
if $data02 != TAble then
return -1
endi
if $data03 != TAble then
return -1
endi
sql select * from `TABle` sql select * from `TABle`
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
if $rows != 2 then if $rows != 2 then
return -1
endi
if $data01 != 40 then
return -1
endi
if $data02 != TABle then
return -1
endi
if $data03 != TABle then
return -1 return -1
endi endi
if $data01 != 40 then
return -1
endi
if $data02 != TABle then
return -1
endi
if $data03 != TABle then
return -1
endi
#print =============== query data from st, but not support select * from super table, waiting fix #print =============== query data from st, but not support select * from super table, waiting fix
#sql select count(*) from `stable` #sql select count(*) from `stable`
#print rows: $rows #print rows: $rows
@ -329,7 +329,7 @@ while $dbCnt < 2
# return -1 # return -1
#endi #endi
#sql select * from `stable` #sql select * from `stable`
#if $rows != 4 then #if $rows != 4 then
# return -1 # return -1
#endi #endi

View File

@ -20,26 +20,26 @@ $x = 0
while $x < 10 while $x < 10
$cc = $x * 60000 $cc = $x * 60000
$ms = 1601481600000 + $cc $ms = 1601481600000 + $cc
sql insert into $tb values ($ms , $x ) sql insert into $tb values ($ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
print =============== step 2 print =============== step 2
$x = 0 $x = 0
while $x < 5 while $x < 5
$cc = $x * 60000 $cc = $x * 60000
$ms = 1551481600000 + $cc $ms = 1551481600000 + $cc
sql insert into $tb values ($ms , $x ) sql insert into $tb values ($ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from $tb sql select * from $tb
print $rows points data are retrieved print $rows points data are retrieved
if $rows != 15 then if $rows != 15 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -18,7 +18,7 @@ print =============== create super table, include column type for count/sum/min/
sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned) sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned)
sql show stables sql show stables
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
@ -28,7 +28,7 @@ sql create table ct2 using stb tags(2000)
sql create table ct3 using stb tags(3000) sql create table ct3 using stb tags(3000)
sql show tables sql show tables
if $rows != 3 then if $rows != 3 then
return -1 return -1
endi endi
@ -46,7 +46,7 @@ sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
#=================================================================== #===================================================================
print =============== query data from child table print =============== query data from child table
sql select * from ct1 sql select * from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
print $data20 $data21 $data22 $data23 print $data20 $data21 $data22 $data23
@ -58,111 +58,111 @@ if $data01 != 10 then
print expect 10, actual: $data01 print expect 10, actual: $data01
return -1 return -1
endi endi
if $data02 != 2.00000 then if $data02 != 2.00000 then
return -1 return -1
endi endi
if $data03 != 3.000000000 then if $data03 != 3.000000000 then
return -1 return -1
endi endi
print =============== select count(*) from child table print =============== select count(*) from child table
sql select count(*) from ct1 sql select count(*) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 4 then if $data00 != 4 then
return -1 return -1
endi endi
print =============== select count(column) from child table print =============== select count(column) from child table
sql select count(ts), count(c1), count(c2), count(c3) from ct1 sql select count(ts), count(c1), count(c2), count(c3) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $data00 != 4 then if $data00 != 4 then
return -1 return -1
endi endi
if $data01 != 4 then if $data01 != 4 then
return -1 return -1
endi endi
if $data02 != 4 then if $data02 != 4 then
return -1 return -1
endi endi
if $data03 != 4 then if $data03 != 4 then
return -1 return -1
endi endi
#print =============== select first(*)/first(column) from child table #print =============== select first(*)/first(column) from child table
sql select first(*) from ct1 sql select first(*) from ct1
print ====> select first(*) from ct1 print ====> select first(*) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
sql select first(ts), first(c1), first(c2), first(c3) from ct1 sql select first(ts), first(c1), first(c2), first(c3) from ct1
print ====> select first(ts), first(c1), first(c2), first(c3) from ct1 print ====> select first(ts), first(c1), first(c2), first(c3) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != 10 then if $data01 != 10 then
return -1 return -1
endi endi
if $data02 != 2.00000 then if $data02 != 2.00000 then
return -1 return -1
endi endi
if $data03 != 3.000000000 then if $data03 != 3.000000000 then
return -1 return -1
endi endi
print =============== select min(column) from child table print =============== select min(column) from child table
sql select min(c1), min(c2), min(c3) from ct1 sql select min(c1), min(c2), min(c3) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != -13 then if $data00 != -13 then
return -1 return -1
endi endi
if $data01 != -2.30000 then if $data01 != -2.30000 then
print expect -2.30000, actual: $data01 print expect -2.30000, actual: $data01
return -1 return -1
endi endi
if $data02 != -3.300000000 then if $data02 != -3.300000000 then
return -1 return -1
endi endi
print =============== select max(column) from child table print =============== select max(column) from child table
sql select max(c1), max(c2), max(c3) from ct1 sql select max(c1), max(c2), max(c3) from ct1
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 11 then if $data00 != 11 then
return -1 return -1
endi endi
if $data01 != 2.10000 then if $data01 != 2.10000 then
return -1 return -1
endi endi
if $data02 != 3.100000000 then if $data02 != 3.100000000 then
return -1 return -1
endi endi
print =============== select sum(column) from child table print =============== select sum(column) from child table
sql select sum(c1), sum(c2), sum(c3) from ct1 sql select sum(c1), sum(c2), sum(c3) from ct1
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != -4 then if $data00 != -4 then
return -1 return -1
endi endi
if $data01 != -0.400000095 then if $data01 != -0.400000095 then
return -1 return -1
endi endi
if $data02 != -0.400000000 then if $data02 != -0.400000000 then
return -1 return -1
endi endi
@ -173,34 +173,34 @@ print $data00 $data01 $data02
print $data10 $data11 $data12 print $data10 $data11 $data12
print $data20 $data21 $data22 print $data20 $data21 $data22
print $data30 $data31 $data32 print $data30 $data31 $data32
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
if $data00 != 10 then if $data00 != 10 then
return -1 return -1
endi endi
if $data01 != 2.00000 then if $data01 != 2.00000 then
return -1 return -1
endi endi
if $data02 != 3.000000000 then if $data02 != 3.000000000 then
return -1 return -1
endi endi
if $data10 != 11 then if $data10 != 11 then
return -1 return -1
endi endi
if $data11 != 2.10000 then if $data11 != 2.10000 then
return -1 return -1
endi endi
if $data12 != 3.100000000 then if $data12 != 3.100000000 then
return -1 return -1
endi endi
if $data30 != -13 then if $data30 != -13 then
return -1 return -1
endi endi
if $data31 != -2.30000 then if $data31 != -2.30000 then
return -1 return -1
endi endi
if $data32 != -3.300000000 then if $data32 != -3.300000000 then
return -1 return -1
endi endi
#=================================================================== #===================================================================
@ -208,17 +208,17 @@ endi
#print =============== query data from stb #print =============== query data from stb
sql select * from stb sql select * from stb
print $rows print $rows
if $rows != 9 then if $rows != 9 then
return -1 return -1
endi endi
#print =============== select count(*) from supter table #print =============== select count(*) from supter table
sql select count(*) from stb sql select count(*) from stb
print $data00 $data01 $data02 print $data00 $data01 $data02
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 9 then if $data00 != 9 then
return -1 return -1
endi endi
@ -234,19 +234,19 @@ print $data50 $data51 $data52 $data53
print $data60 $data61 $data62 $data63 print $data60 $data61 $data62 $data63
print $data70 $data71 $data72 $data73 print $data70 $data71 $data72 $data73
print $data80 $data81 $data82 $data83 print $data80 $data81 $data82 $data83
if $rows != 9 then if $rows != 9 then
return -1 return -1
endi endi
# The order of data from different sub tables in the super table is random, # The order of data from different sub tables in the super table is random,
# so this detection may fail randomly # so this detection may fail randomly
if $data01 != 10 then if $data01 != 10 then
return -1 return -1
endi endi
if $data02 != 2.00000 then if $data02 != 2.00000 then
return -1 return -1
endi endi
if $data03 != 3.000000000 then if $data03 != 3.000000000 then
return -1 return -1
endi endi
@ -254,16 +254,16 @@ endi
sql select count(ts), count(c1), count(c2), count(c3) from stb sql select count(ts), count(c1), count(c2), count(c3) from stb
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $data00 != 9 then if $data00 != 9 then
return -1 return -1
endi endi
if $data01 != 9 then if $data01 != 9 then
return -1 return -1
endi endi
if $data02 != 9 then if $data02 != 9 then
return -1 return -1
endi endi
if $data03 != 9 then if $data03 != 9 then
return -1 return -1
endi endi
@ -274,7 +274,7 @@ system sh/exec.sh -n dnode1 -s start
print =============== query data from child table print =============== query data from child table
sql select * from ct1 sql select * from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13 print $data10 $data11 $data12 $data13
print $data20 $data21 $data22 $data23 print $data20 $data21 $data22 $data23
@ -282,113 +282,113 @@ print $data30 $data31 $data32 $data33
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
if $data01 != 10 then if $data01 != 10 then
return -1 return -1
endi endi
if $data02 != 2.00000 then if $data02 != 2.00000 then
return -1 return -1
endi endi
if $data03 != 3.000000000 then if $data03 != 3.000000000 then
return -1 return -1
endi endi
print =============== select count(*) from child table print =============== select count(*) from child table
sql select count(*) from ct1 sql select count(*) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 4 then if $data00 != 4 then
return -1 return -1
endi endi
print =============== select count(column) from child table print =============== select count(column) from child table
sql select count(ts), count(c1), count(c2), count(c3) from ct1 sql select count(ts), count(c1), count(c2), count(c3) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $data00 != 4 then if $data00 != 4 then
return -1 return -1
endi endi
if $data01 != 4 then if $data01 != 4 then
return -1 return -1
endi endi
if $data02 != 4 then if $data02 != 4 then
return -1 return -1
endi endi
if $data03 != 4 then if $data03 != 4 then
return -1 return -1
endi endi
#print =============== select first(*)/first(column) from child table #print =============== select first(*)/first(column) from child table
sql select first(*) from ct1 sql select first(*) from ct1
print ====> select first(*) from ct1 print ====> select first(*) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
sql select first(ts), first(c1), first(c2), first(c3) from ct1 sql select first(ts), first(c1), first(c2), first(c3) from ct1
print ====> select first(ts), first(c1), first(c2), first(c3) from ct1 print ====> select first(ts), first(c1), first(c2), first(c3) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data01 != 10 then if $data01 != 10 then
return -1 return -1
endi endi
if $data02 != 2.00000 then if $data02 != 2.00000 then
return -1 return -1
endi endi
if $data03 != 3.000000000 then if $data03 != 3.000000000 then
return -1 return -1
endi endi
print =============== select min(column) from child table print =============== select min(column) from child table
sql select min(c1), min(c2), min(c3) from ct1 sql select min(c1), min(c2), min(c3) from ct1
print rows: $rows print rows: $rows
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != -13 then if $data00 != -13 then
return -1 return -1
endi endi
if $data01 != -2.30000 then if $data01 != -2.30000 then
return -1 return -1
endi endi
if $data02 != -3.300000000 then if $data02 != -3.300000000 then
return -1 return -1
endi endi
print =============== select max(column) from child table print =============== select max(column) from child table
sql select max(c1), max(c2), max(c3) from ct1 sql select max(c1), max(c2), max(c3) from ct1
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 11 then if $data00 != 11 then
return -1 return -1
endi endi
if $data01 != 2.10000 then if $data01 != 2.10000 then
return -1 return -1
endi endi
if $data02 != 3.100000000 then if $data02 != 3.100000000 then
return -1 return -1
endi endi
print =============== select sum(column) from child table print =============== select sum(column) from child table
sql select sum(c1), sum(c2), sum(c3) from ct1 sql select sum(c1), sum(c2), sum(c3) from ct1
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != -4 then if $data00 != -4 then
return -1 return -1
endi endi
if $data01 != -0.400000095 then if $data01 != -0.400000095 then
return -1 return -1
endi endi
if $data02 != -0.400000000 then if $data02 != -0.400000000 then
return -1 return -1
endi endi
@ -399,51 +399,51 @@ print $data00 $data01 $data02
print $data10 $data11 $data12 print $data10 $data11 $data12
print $data20 $data21 $data22 print $data20 $data21 $data22
print $data30 $data31 $data32 print $data30 $data31 $data32
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
if $data00 != 10 then if $data00 != 10 then
return -1 return -1
endi endi
if $data01 != 2.00000 then if $data01 != 2.00000 then
return -1 return -1
endi endi
if $data02 != 3.000000000 then if $data02 != 3.000000000 then
return -1 return -1
endi endi
if $data10 != 11 then if $data10 != 11 then
return -1 return -1
endi endi
if $data11 != 2.10000 then if $data11 != 2.10000 then
return -1 return -1
endi endi
if $data12 != 3.100000000 then if $data12 != 3.100000000 then
return -1 return -1
endi endi
if $data30 != -13 then if $data30 != -13 then
return -1 return -1
endi endi
if $data31 != -2.30000 then if $data31 != -2.30000 then
return -1 return -1
endi endi
if $data32 != -3.300000000 then if $data32 != -3.300000000 then
return -1 return -1
endi endi
#=================================================================== #===================================================================
print =============== query data from stb print =============== query data from stb
sql select * from stb sql select * from stb
if $rows != 9 then if $rows != 9 then
return -1 return -1
endi endi
print =============== select count(*) from supter table print =============== select count(*) from supter table
sql select count(*) from stb sql select count(*) from stb
print $data00 $data01 $data02 print $data00 $data01 $data02
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 9 then if $data00 != 9 then
return -1 return -1
endi endi
@ -459,35 +459,35 @@ print $data50 $data51 $data52 $data53
print $data60 $data61 $data62 $data63 print $data60 $data61 $data62 $data63
print $data70 $data71 $data72 $data73 print $data70 $data71 $data72 $data73
print $data80 $data81 $data82 $data83 print $data80 $data81 $data82 $data83
if $rows != 9 then if $rows != 9 then
return -1 return -1
endi endi
# The order of data from different sub tables in the super table is random, # The order of data from different sub tables in the super table is random,
# so this detection may fail randomly # so this detection may fail randomly
if $data01 != 10 then if $data01 != 10 then
return -1 return -1
endi endi
if $data02 != 2.00000 then if $data02 != 2.00000 then
return -1 return -1
endi endi
if $data03 != 3.000000000 then if $data03 != 3.000000000 then
return -1 return -1
endi endi
#print =============== select count(column) from supter table #print =============== select count(column) from supter table
sql select count(ts), count(c1), count(c2), count(c3) from stb sql select count(ts), count(c1), count(c2), count(c3) from stb
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $data00 != 9 then if $data00 != 9 then
return -1 return -1
endi endi
if $data01 != 9 then if $data01 != 9 then
return -1 return -1
endi endi
if $data02 != 9 then if $data02 != 9 then
return -1 return -1
endi endi
if $data03 != 9 then if $data03 != 9 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -21,7 +21,7 @@ sql create table stb_2 (ts timestamp, i int) tags (j int)
sql create stable stb_3 (ts timestamp, i int) tags (j int) sql create stable stb_3 (ts timestamp, i int) tags (j int)
sql show stables sql show stables
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
@ -30,7 +30,7 @@ sql create table c1 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl
sql create table c2 using stb tags(false, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 2', 'child tbl 2', '2022-02-25 18:00:00.000', 10, 20, 30, 40) sql create table c2 using stb tags(false, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 2', 'child tbl 2', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
sql show tables sql show tables
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
@ -39,12 +39,12 @@ sql insert into c1 values(now+0s, true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1
print =============== query data print =============== query data
sql select * from c1 sql select * from c1
print rows: $rows print rows: $rows
print $data00 $data01 print $data00 $data01
print $data10 $data11 print $data10 $data11
print $data20 $data21 print $data20 $data21
print $data30 $data31 print $data30 $data31
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
@ -53,17 +53,17 @@ if $data01 != 1 then
return -1 return -1
endi endi
if $data02 != -1 then if $data02 != -1 then
return -1 return -1
endi endi
if $data03 != -2 then if $data03 != -2 then
return -1 return -1
endi endi
print =============== query data from st, but not support select * from super table, waiting fix print =============== query data from st, but not support select * from super table, waiting fix
sql select * from stb sql select * from stb
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
@ -73,12 +73,12 @@ system sh/exec.sh -n dnode1 -s start
print =============== query data print =============== query data
sql select * from c1 sql select * from c1
print rows: $rows print rows: $rows
print $data00 $data01 print $data00 $data01
print $data10 $data11 print $data10 $data11
print $data20 $data21 print $data20 $data21
print $data30 $data31 print $data30 $data31
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi
@ -86,17 +86,17 @@ if $data01 != 1 then
return -1 return -1
endi endi
if $data02 != -1 then if $data02 != -1 then
return -1 return -1
endi endi
if $data03 != -2 then if $data03 != -2 then
return -1 return -1
endi endi
print =============== query data from st, but not support select * from super table, waiting fix print =============== query data from st, but not support select * from super table, waiting fix
sql select * from stb sql select * from stb
if $rows != 4 then if $rows != 4 then
return -1 return -1
endi endi

View File

@ -11,7 +11,7 @@ print =============== create super table
sql create table if not exists stb (ts timestamp, c1 int unsigned, c2 double, c3 binary(10), c4 nchar(10), c5 double) tags (city binary(20),district binary(20)); sql create table if not exists stb (ts timestamp, c1 int unsigned, c2 double, c3 binary(10), c4 nchar(10), c5 double) tags (city binary(20),district binary(20));
sql show stables sql show stables
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
@ -20,7 +20,7 @@ sql create table ct1 using stb tags("BeiJing", "ChaoYang")
sql create table ct2 using stb tags("BeiJing", "HaiDian") sql create table ct2 using stb tags("BeiJing", "HaiDian")
sql show tables sql show tables
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
@ -47,7 +47,7 @@ print $data20 $data21 $data22 $data23 $data24 $data25
print $data30 $data31 $data32 $data33 $data34 $data35 print $data30 $data31 $data32 $data33 $data34 $data35
print $data40 $data41 $data42 $data43 $data44 $data45 print $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then if $rows != 5 then
print rows $rows != 5 print rows $rows != 5
return -1 return -1
endi endi
@ -189,7 +189,7 @@ print $data20 $data21 $data22 $data23 $data24 $data25
print $data30 $data31 $data32 $data33 $data34 $data35 print $data30 $data31 $data32 $data33 $data34 $data35
print $data40 $data41 $data42 $data43 $data44 $data45 print $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then if $rows != 5 then
print rows $rows != 5 print rows $rows != 5
return -1 return -1
endi endi
@ -319,4 +319,4 @@ if $data45 != 30.000000000 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -63,7 +63,7 @@ reboot_and_check:
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
print =============== insert duplicated records to memory - loop $reboot_max - $reboot_cnt print =============== insert duplicated records to memory - loop $reboot_max - $reboot_cnt
sql use db sql use db
sql insert into ct1 values ('2022-05-01 18:30:27.001', 0.0); sql insert into ct1 values ('2022-05-01 18:30:27.001', 0.0);
sql insert into ct4 values ('2022-04-28 18:30:27.002', 0.0); sql insert into ct4 values ('2022-04-28 18:30:27.002', 0.0);
@ -91,7 +91,7 @@ sql insert into ct4 values ('2018-05-01 18:30:27.023', NULL) ;
sql insert into ct4 values ('2021-03-01 18:30:27.024', NULL) ; sql insert into ct4 values ('2021-03-01 18:30:27.024', NULL) ;
sql insert into ct4 values ('2022-08-01 18:30:27.025', NULL) ; sql insert into ct4 values ('2022-08-01 18:30:27.025', NULL) ;
print =============== select * from ct1 - merge memory and file - loop $reboot_max - $reboot_cnt print =============== select * from ct1 - merge memory and file - loop $reboot_max - $reboot_cnt
sql select * from ct1; sql select * from ct1;
if $rows != 13 then if $rows != 13 then
print rows = $rows != 13 print rows = $rows != 13
@ -163,8 +163,8 @@ if $data[12][1] != -99.990000000 then
print $data[12][1] != -99.990000000 print $data[12][1] != -99.990000000
return -1 return -1
endi endi
print =============== select * from ct4 - merge memory and file - loop $reboot_max - $reboot_cnt print =============== select * from ct4 - merge memory and file - loop $reboot_max - $reboot_cnt
sql select * from ct4; sql select * from ct4;
if $rows != 12 then if $rows != 12 then
print rows = $rows != 12 print rows = $rows != 12

View File

@ -25,16 +25,16 @@ $ts = $ts0
while $i < 10 while $i < 10
$tb = tb . $i $tb = tb . $i
sql create table $tb using $stb tags( $i ) sql create table $tb using $stb tags( $i )
$x = 0 $x = 0
while $x < $rowNum while $x < $rowNum
$xs = $x * $delta $xs = $x * $delta
$ts = $ts0 + $xs $ts = $ts0 + $xs
sql insert into $tb values ( $ts , $x ) sql insert into $tb values ( $ts , $x )
$x = $x + 1 $x = $x + 1
endw endw
$i = $i + 1 $i = $i + 1
endw endw
print ====== tables created print ====== tables created
print ================== restart server to commit data into disk print ================== restart server to commit data into disk
@ -46,18 +46,18 @@ sql use $db
sql drop table tb5 sql drop table tb5
$i = 0 $i = 0
while $i < 4 while $i < 4
$tb = tb . $i $tb = tb . $i
$x = 0 $x = 0
while $x < $rowNum while $x < $rowNum
$xs = $x * $delta $xs = $x * $delta
$ts = $ts0 + $xs $ts = $ts0 + $xs
sql insert into $tb values ( $ts , $x ) sql insert into $tb values ( $ts , $x )
$x = $x + 1 $x = $x + 1
endw endw
$i = $i + 1 $i = $i + 1
endw endw
print ================== restart server to commit data into disk print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
@ -73,4 +73,4 @@ if $rows != 0 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
sql connect sql connect
print ======== step1 print ======== step1
sql drop database if exists db1; sql drop database if exists db1;
sql create database db1 vgroups 3; sql create database db1 vgroups 3;
sql use db1; sql use db1;

View File

@ -18,7 +18,7 @@ print =============== create super table, include column type for count/sum/min/
sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double, c4 bigint) tags (t1 int unsigned) sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double, c4 bigint) tags (t1 int unsigned)
sql show stables sql show stables
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
@ -28,7 +28,7 @@ sql create table ct2 using stb tags(2000)
sql create table ct3 using stb tags(3000) sql create table ct3 using stb tags(3000)
sql show tables sql show tables
if $rows != 3 then if $rows != 3 then
return -1 return -1
endi endi
@ -55,22 +55,22 @@ print ===> rows4: $data40 $data41 $data42 $data43 $data44
if $rows != 12 then if $rows != 12 then
return -1 return -1
endi endi
if $data01 != 10 then if $data01 != 10 then
return -1 return -1
endi endi
if $data02 != 2.00000 then if $data02 != 2.00000 then
return -1 return -1
endi endi
if $data03 != 3.000000000 then if $data03 != 3.000000000 then
return -1 return -1
endi endi
#if $data41 != -14 then #if $data41 != -14 then
# return -1 # return -1
#endi #endi
#if $data42 != -2.40000 then #if $data42 != -2.40000 then
# return -1 # return -1
#endi #endi
#if $data43 != -3.400000000 then #if $data43 != -3.400000000 then
# return -1 # return -1
#endi #endi
@ -79,10 +79,10 @@ sql select count(*) from ct1
print ===> select count(*) from ct1 print ===> select count(*) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 12 then if $data00 != 12 then
return -1 return -1
endi endi
@ -91,16 +91,16 @@ sql select count(ts), count(c1), count(c2), count(c3) from ct1
print ===> select count(ts), count(c1), count(c2), count(c3) from ct1 print ===> select count(ts), count(c1), count(c2), count(c3) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $data00 != 12 then if $data00 != 12 then
return -1 return -1
endi endi
if $data01 != 8 then if $data01 != 8 then
return -1 return -1
endi endi
if $data02 != 8 then if $data02 != 8 then
return -1 return -1
endi endi
if $data03 != 8 then if $data03 != 8 then
return -1 return -1
endi endi
@ -113,16 +113,16 @@ sql select min(c1), min(c2), min(c3) from ct1
print ===> select min(c1), min(c2), min(c3) from ct1 print ===> select min(c1), min(c2), min(c3) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != -2147483647 then if $data00 != -2147483647 then
return -1 return -1
endi endi
if $data01 != 2.00000 then if $data01 != 2.00000 then
return -1 return -1
endi endi
if $data02 != 3.000000000 then if $data02 != 3.000000000 then
return -1 return -1
endi endi
@ -131,16 +131,16 @@ sql select max(c1), max(c2), max(c3) from ct1
print ===> select max(c1), max(c2), max(c3) from ct1 print ===> select max(c1), max(c2), max(c3) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 16 then if $data00 != 16 then
return -1 return -1
endi endi
if $data01 != 2.70000 then if $data01 != 2.70000 then
return -1 return -1
endi endi
if $data02 != 3.700000000 then if $data02 != 3.700000000 then
return -1 return -1
endi endi
@ -149,16 +149,16 @@ sql select sum(c1), sum(c2), sum(c3) from ct1
print ===> select sum(c1), sum(c2), sum(c3) from ct1 print ===> select sum(c1), sum(c2), sum(c3) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != -2147483556 then if $data00 != -2147483556 then
return -1 return -1
endi endi
if $data01 != 18.799999952 then if $data01 != 18.799999952 then
return -1 return -1
endi endi
if $data02 != 26.800000000 then if $data02 != 26.800000000 then
return -1 return -1
endi endi
@ -167,43 +167,43 @@ sql select c1, c2, c3 from ct1
print ===> select c1, c2, c3 from ct1 print ===> select c1, c2, c3 from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 12 then if $rows != 12 then
return -1 return -1
endi endi
if $data00 != 10 then if $data00 != 10 then
return -1 return -1
endi endi
if $data01 != 2.00000 then if $data01 != 2.00000 then
return -1 return -1
endi endi
if $data02 != 3.000000000 then if $data02 != 3.000000000 then
return -1 return -1
endi endi
if $data10 != NULL then if $data10 != NULL then
return -1 return -1
endi endi
if $data11 != NULL then if $data11 != NULL then
return -1 return -1
endi endi
if $data12 != NULL then if $data12 != NULL then
return -1 return -1
endi endi
if $data30 != 11 then if $data30 != 11 then
return -1 return -1
endi endi
if $data31 != NULL then if $data31 != NULL then
return -1 return -1
endi endi
if $data32 != 3.200000000 then if $data32 != 3.200000000 then
return -1 return -1
endi endi
if $data90 != 16 then if $data90 != 16 then
return -1 return -1
endi endi
if $data91 != 2.60000 then if $data91 != 2.60000 then
return -1 return -1
endi endi
if $data92 != 3.600000000 then if $data92 != 3.600000000 then
return -1 return -1
endi endi
#=================================================================== #===================================================================
@ -211,36 +211,36 @@ endi
#print =============== query data from stb #print =============== query data from stb
sql select * from stb sql select * from stb
print ===> print ===>
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 12 then if $rows != 12 then
return -1 return -1
endi endi
#print =============== select count(*) from supter table #print =============== select count(*) from supter table
sql select count(*) from stb sql select count(*) from stb
print $data00 $data01 $data02 print $data00 $data01 $data02
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 12 then if $data00 != 12 then
return -1 return -1
endi endi
#print =============== select count(column) from supter table #print =============== select count(column) from supter table
sql select count(ts), count(c1), count(c2), count(c3) from stb sql select count(ts), count(c1), count(c2), count(c3) from stb
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $data00 != 12 then if $data00 != 12 then
return -1 return -1
endi endi
if $data01 != 8 then if $data01 != 8 then
return -1 return -1
endi endi
if $data02 != 8 then if $data02 != 8 then
return -1 return -1
endi endi
if $data03 != 8 then if $data03 != 8 then
return -1 return -1
endi endi
@ -264,22 +264,22 @@ print ===> rows4: $data40 $data41 $data42 $data43 $data44
if $rows != 12 then if $rows != 12 then
return -1 return -1
endi endi
if $data01 != 10 then if $data01 != 10 then
return -1 return -1
endi endi
if $data02 != 2.00000 then if $data02 != 2.00000 then
return -1 return -1
endi endi
if $data03 != 3.000000000 then if $data03 != 3.000000000 then
return -1 return -1
endi endi
if $data41 != 12 then if $data41 != 12 then
return -1 return -1
endi endi
if $data42 != 2.20000 then if $data42 != 2.20000 then
return -1 return -1
endi endi
if $data43 != NULL then if $data43 != NULL then
return -1 return -1
endi endi
@ -288,10 +288,10 @@ sql select count(*) from ct1
print ===> select count(*) from ct1 print ===> select count(*) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 12 then if $data00 != 12 then
return -1 return -1
endi endi
@ -300,16 +300,16 @@ sql select count(ts), count(c1), count(c2), count(c3) from ct1
print ===> select count(ts), count(c1), count(c2), count(c3) from ct1 print ===> select count(ts), count(c1), count(c2), count(c3) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $data00 != 12 then if $data00 != 12 then
return -1 return -1
endi endi
if $data01 != 8 then if $data01 != 8 then
return -1 return -1
endi endi
if $data02 != 8 then if $data02 != 8 then
return -1 return -1
endi endi
if $data03 != 8 then if $data03 != 8 then
return -1 return -1
endi endi
@ -322,16 +322,16 @@ sql select min(c1), min(c2), min(c3) from ct1
print ===> select min(c1), min(c2), min(c3) from ct1 print ===> select min(c1), min(c2), min(c3) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != -2147483647 then if $data00 != -2147483647 then
return -1 return -1
endi endi
if $data01 != 2.00000 then if $data01 != 2.00000 then
return -1 return -1
endi endi
if $data02 != 3.000000000 then if $data02 != 3.000000000 then
return -1 return -1
endi endi
@ -340,16 +340,16 @@ sql select max(c1), max(c2), max(c3) from ct1
print ===> select max(c1), max(c2), max(c3) from ct1 print ===> select max(c1), max(c2), max(c3) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 16 then if $data00 != 16 then
return -1 return -1
endi endi
if $data01 != 2.70000 then if $data01 != 2.70000 then
return -1 return -1
endi endi
if $data02 != 3.700000000 then if $data02 != 3.700000000 then
return -1 return -1
endi endi
@ -358,16 +358,16 @@ sql select sum(c1), sum(c2), sum(c3) from ct1
print ===> select sum(c1), sum(c2), sum(c3) from ct1 print ===> select sum(c1), sum(c2), sum(c3) from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != -2147483556 then if $data00 != -2147483556 then
return -1 return -1
endi endi
if $data01 != 18.799999952 then if $data01 != 18.799999952 then
return -1 return -1
endi endi
if $data02 != 26.800000000 then if $data02 != 26.800000000 then
return -1 return -1
endi endi
@ -376,78 +376,78 @@ sql select c1, c2, c3 from ct1
print ===> select c1, c2, c3 from ct1 print ===> select c1, c2, c3 from ct1
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 12 then if $rows != 12 then
return -1 return -1
endi endi
if $data00 != 10 then if $data00 != 10 then
return -1 return -1
endi endi
if $data01 != 2.00000 then if $data01 != 2.00000 then
return -1 return -1
endi endi
if $data02 != 3.000000000 then if $data02 != 3.000000000 then
return -1 return -1
endi endi
if $data10 != NULL then if $data10 != NULL then
return -1 return -1
endi endi
if $data11 != NULL then if $data11 != NULL then
return -1 return -1
endi endi
if $data12 != NULL then if $data12 != NULL then
return -1 return -1
endi endi
if $data30 != 11 then if $data30 != 11 then
return -1 return -1
endi endi
if $data31 != NULL then if $data31 != NULL then
return -1 return -1
endi endi
if $data32 != 3.200000000 then if $data32 != 3.200000000 then
return -1 return -1
endi endi
if $data90 != 16 then if $data90 != 16 then
return -1 return -1
endi endi
if $data91 != 2.60000 then if $data91 != 2.60000 then
return -1 return -1
endi endi
if $data92 != 3.600000000 then if $data92 != 3.600000000 then
return -1 return -1
endi endi
#=================================================================== #===================================================================
print =============== query data from stb print =============== query data from stb
sql select * from stb sql select * from stb
print ===> print ===>
print ===> rows: $rows print ===> rows: $rows
print ===> rows0: $data00 $data01 $data02 $data03 $data04 print ===> rows0: $data00 $data01 $data02 $data03 $data04
if $rows != 12 then if $rows != 12 then
return -1 return -1
endi endi
print =============== select count(*) from supter table print =============== select count(*) from supter table
sql select count(*) from stb sql select count(*) from stb
print $data00 $data01 $data02 print $data00 $data01 $data02
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 12 then if $data00 != 12 then
return -1 return -1
endi endi
print =============== select count(column) from supter table print =============== select count(column) from supter table
sql select count(ts), count(c1), count(c2), count(c3) from stb sql select count(ts), count(c1), count(c2), count(c3) from stb
print $data00 $data01 $data02 $data03 print $data00 $data01 $data02 $data03
if $data00 != 12 then if $data00 != 12 then
return -1 return -1
endi endi
if $data01 != 8 then if $data01 != 8 then
return -1 return -1
endi endi
if $data02 != 8 then if $data02 != 8 then
return -1 return -1
endi endi
if $data03 != 8 then if $data03 != 8 then
return -1 return -1
endi endi

View File

@ -16,36 +16,36 @@ sql create database $db
sql use $db sql use $db
sql create table $tb (ts timestamp, speed int) sql create table $tb (ts timestamp, speed int)
#commit to file will trigger if insert 82 rows #commit to file will trigger if insert 82 rows
$N = 82 $N = 82
print =============== step 1 print =============== step 1
$x = $N $x = $N
$y = $N / 2 $y = $N / 2
while $x > $y while $x > $y
$ms = $x . m $ms = $x . m
$xt = - . $x $xt = - . $x
sql insert into $tb values (now - $ms , -$x ) sql insert into $tb values (now - $ms , -$x )
$x = $x - 1 $x = $x - 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $y then if $rows != $y then
return -1 return -1
endi endi
$x = $N / 2 $x = $N / 2
$y = $N $y = $N
while $x < $y while $x < $y
$ms = $x . m $ms = $x . m
sql insert into $tb values (now + $ms , $x ) sql insert into $tb values (now + $ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $N then if $rows != $N then
return -1 return -1
endi endi
@ -53,18 +53,18 @@ print =============== step 2
$R = 4 $R = 4
$x = $N * 2 $x = $N * 2
$y = $N * $R $y = $N * $R
$expect = $y + $N $expect = $y + $N
$y = $y + $x $y = $y + $x
while $x < $y while $x < $y
$ms = $x . m $ms = $x . m
sql insert into $tb values (now + $ms , $x ) sql insert into $tb values (now + $ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $expect then if $rows != $expect then
return -1 return -1
endi endi
@ -100,7 +100,7 @@ endi
sql select * from $tb where ts < $start2 and ts > $end1 sql select * from $tb where ts < $start2 and ts > $end1
print select * from $tb where ts < $start2 and ts > $end1 -> $rows points print select * from $tb where ts < $start2 and ts > $end1 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -115,23 +115,23 @@ if $rows != 0 then
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 sql select * from $tb where ts < $start3 and ts > $end1
print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 sql select * from $tb where ts < $start3 and ts > $end2
print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end3 sql select * from $tb where ts < $start3 and ts > $end3
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
print ================= order by ts desc print ================= order by ts desc
sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc
if $rows != 0 then if $rows != 0 then
@ -148,9 +148,9 @@ if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc
print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -164,15 +164,15 @@ if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -185,8 +185,8 @@ clear:
sql drop database $db sql drop database $db
sql select * from information_schema.ins_databases sql select * from information_schema.ins_databases
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -17,9 +17,9 @@ sql use $db
sql create table $tb (ts timestamp, speed int) sql create table $tb (ts timestamp, speed int)
#commit to file will trigger if insert 82 rows #commit to file will trigger if insert 82 rows
$N = 82 $N = 82
print =============== step 1 print =============== step 1
$x = $N $x = $N
@ -28,14 +28,14 @@ while $x > $y
$z = $x * 60000 $z = $x * 60000
$ms = 1601481600000 - $z $ms = 1601481600000 - $z
$xt = - . $x $xt = - . $x
sql insert into $tb values ($ms , -$x ) sql insert into $tb values ($ms , -$x )
$x = $x - 1 $x = $x - 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $y then if $rows != $y then
return -1 return -1
endi endi
@ -45,12 +45,12 @@ while $x < $y
$z = $x * 60000 $z = $x * 60000
$ms = 1601481600000 + $z $ms = 1601481600000 + $z
sql insert into $tb values ($ms , $x ) sql insert into $tb values ($ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $N then if $rows != $N then
return -1 return -1
endi endi
@ -69,100 +69,100 @@ $end2 = 1601481600000
$end3 = 1601481600000 + $step $end3 = 1601481600000 + $step
sql select * from $tb where ts < $start1 and ts > $end1 sql select * from $tb where ts < $start1 and ts > $end1
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start1 and ts > $end2 sql select * from $tb where ts < $start1 and ts > $end2
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start1 and ts > $end3 sql select * from $tb where ts < $start1 and ts > $end3
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end1 sql select * from $tb where ts < $start2 and ts > $end1
print select * from $tb where ts < $start2 and ts > $end1 -> $rows points print select * from $tb where ts < $start2 and ts > $end1 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end2 sql select * from $tb where ts < $start2 and ts > $end2
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end3 sql select * from $tb where ts < $start2 and ts > $end3
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 sql select * from $tb where ts < $start3 and ts > $end1
print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 sql select * from $tb where ts < $start3 and ts > $end2
print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end3 sql select * from $tb where ts < $start3 and ts > $end3
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
print ================= order by ts desc print ================= order by ts desc
sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start1 and ts > $end2 order by ts desc sql select * from $tb where ts < $start1 and ts > $end2 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start1 and ts > $end3 order by ts desc sql select * from $tb where ts < $start1 and ts > $end3 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc
print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end2 order by ts desc sql select * from $tb where ts < $start2 and ts > $end2 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end3 order by ts desc sql select * from $tb where ts < $start2 and ts > $end3 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end3 order by ts desc sql select * from $tb where ts < $start3 and ts > $end3 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
@ -170,8 +170,8 @@ clear:
sql drop database $db sql drop database $db
sql select * from information_schema.ins_databases sql select * from information_schema.ins_databases
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -16,23 +16,23 @@ sql create database $db
sql use $db sql use $db
sql create table $tb (ts timestamp, speed int) sql create table $tb (ts timestamp, speed int)
#commit to file will trigger if insert 82 rows #commit to file will trigger if insert 82 rows
$N = 82 $N = 82
print =============== step 1 print =============== step 1
$x = $N * 2 $x = $N * 2
$y = $N $y = $N
$expect = $N $expect = $N
while $x > $y while $x > $y
$ms = $x . m $ms = $x . m
$xt = - . $x $xt = - . $x
sql insert into $tb values (now - $ms , $xt ) sql insert into $tb values (now - $ms , $xt )
$x = $x - 1 $x = $x - 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $expect then if $rows != $expect then
return -1 return -1
endi endi
@ -40,20 +40,20 @@ $x = $N
$y = $N * 2 $y = $N * 2
$expect = $N * 2 $expect = $N * 2
while $x < $y while $x < $y
$ms = $x . m $ms = $x . m
sql insert into $tb values (now + $ms , $x ) sql insert into $tb values (now + $ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $expect then if $rows != $expect then
return -1 return -1
endi endi
print =============== step 2 print =============== step 2
$R = 4 $R = 4
$y = $N * $R $y = $N * $R
$expect = $y + $N $expect = $y + $N
$expect = $expect + $N $expect = $expect + $N
@ -62,17 +62,17 @@ $x = $N * 3
$y = $y + $x $y = $y + $x
while $x < $y while $x < $y
$ms = $x . m $ms = $x . m
sql insert into $tb values (now + $ms , $x ) sql insert into $tb values (now + $ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $expect then if $rows != $expect then
return -1 return -1
endi endi
print =============== step 2 print =============== step 2
@ -106,7 +106,7 @@ endi
sql select * from $tb where ts < $start2 and ts > $end1 sql select * from $tb where ts < $start2 and ts > $end1
print select * from $tb where ts < $start2 and ts > $end1 -> $rows points print select * from $tb where ts < $start2 and ts > $end1 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -121,14 +121,14 @@ if $rows != 0 then
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 sql select * from $tb where ts < $start3 and ts > $end1
print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 sql select * from $tb where ts < $start3 and ts > $end2
print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -137,7 +137,7 @@ if $rows != 0 then
return -1 return -1
endi endi
print ================= order by ts desc print ================= order by ts desc
sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc
if $rows != 0 then if $rows != 0 then
@ -154,9 +154,9 @@ if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc
print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -170,15 +170,15 @@ if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -191,8 +191,8 @@ clear:
sql drop database $db sql drop database $db
sql select * from information_schema.ins_databases sql select * from information_schema.ins_databases
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -14,22 +14,22 @@ sql drop database -x step1
step1: step1:
sql create database $db sql create database $db
sql use $db sql use $db
sql create table $tb (ts timestamp, speed int) sql create table $tb (ts timestamp, speed int)
$N = 82 $N = 82
$x = $N * 2 $x = $N * 2
$y = $N $y = $N
while $x > $y while $x > $y
$ms = $x . m $ms = $x . m
$xt = - . $x $xt = - . $x
sql insert into $tb values (now - $ms , $xt ) sql insert into $tb values (now - $ms , $xt )
$x = $x - 1 $x = $x - 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $y then if $rows != $y then
return -1 return -1
endi endi
@ -37,13 +37,13 @@ $x = $N
$y = $N * 2 $y = $N * 2
$expect = $N * 2 $expect = $N * 2
while $x < $y while $x < $y
$ms = $x . m $ms = $x . m
sql insert into $tb values (now + $ms , $x ) sql insert into $tb values (now + $ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $expect then if $rows != $expect then
return -1 return -1
endi endi
@ -63,107 +63,107 @@ $end2 = now
$end3 = now+ . $step $end3 = now+ . $step
sql select * from $tb where ts < $start1 and ts > $end1 sql select * from $tb where ts < $start1 and ts > $end1
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start1 and ts > $end2 sql select * from $tb where ts < $start1 and ts > $end2
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start1 and ts > $end3 sql select * from $tb where ts < $start1 and ts > $end3
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end1 sql select * from $tb where ts < $start2 and ts > $end1
print select * from $tb where ts < $start2 and ts > $end1 -> $rows points print select * from $tb where ts < $start2 and ts > $end1 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end2 sql select * from $tb where ts < $start2 and ts > $end2
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end3 sql select * from $tb where ts < $start2 and ts > $end3
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 sql select * from $tb where ts < $start3 and ts > $end1
print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 sql select * from $tb where ts < $start3 and ts > $end2
print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end3 sql select * from $tb where ts < $start3 and ts > $end3
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
print ================= order by ts desc print ================= order by ts desc
sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start1 and ts > $end2 order by ts desc sql select * from $tb where ts < $start1 and ts > $end2 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start1 and ts > $end3 order by ts desc sql select * from $tb where ts < $start1 and ts > $end3 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc
print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end2 order by ts desc sql select * from $tb where ts < $start2 and ts > $end2 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end3 order by ts desc sql select * from $tb where ts < $start2 and ts > $end3 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end3 order by ts desc sql select * from $tb where ts < $start3 and ts > $end3 order by ts desc
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql drop database $db sql drop database $db
sql select * from information_schema.ins_databases sql select * from information_schema.ins_databases
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -17,23 +17,23 @@ sql use $db
sql create table $tb (ts timestamp, speed int) sql create table $tb (ts timestamp, speed int)
#commit to file will trigger if insert 82 rows #commit to file will trigger if insert 82 rows
$N = 82 $N = 82
$x = $N * 2 $x = $N * 2
$y = $N $y = $N
$expect = $y $expect = $y
while $x > $y while $x > $y
$ms = $x . m $ms = $x . m
$xt = - . $x $xt = - . $x
sql insert into $tb values (now - $ms , $xt ) sql insert into $tb values (now - $ms , $xt )
$x = $x - 1 $x = $x - 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $expect then if $rows != $expect then
return -1 return -1
endi endi
@ -41,37 +41,37 @@ $x = $N
$y = $N * 2 $y = $N * 2
$expect = $N * 2 $expect = $N * 2
while $x < $y while $x < $y
$ms = $x . m $ms = $x . m
sql insert into $tb values (now + $ms , $x ) sql insert into $tb values (now + $ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $expect then if $rows != $expect then
return -1 return -1
endi endi
$R = 4 $R = 4
$R = $R - 1 $R = $R - 1
$y = $N * $R $y = $N * $R
$expect = $y + $N $expect = $y + $N
$expect = $expect + $N $expect = $expect + $N
$x = $N * 3 $x = $N * 3
$y = $y + $x $y = $y + $x
while $x < $y while $x < $y
$ms = $x . m $ms = $x . m
sql insert into $tb values (now + $ms , $x ) sql insert into $tb values (now + $ms , $x )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from $tb sql select * from $tb
print sql select * from $tb -> $rows points print sql select * from $tb -> $rows points
if $rows != $expect then if $rows != $expect then
return -1 return -1
endi endi
print =============== step 2 print =============== step 2
@ -105,7 +105,7 @@ endi
sql select * from $tb where ts < $start2 and ts > $end1 sql select * from $tb where ts < $start2 and ts > $end1
print select * from $tb where ts < $start2 and ts > $end1 -> $rows points print select * from $tb where ts < $start2 and ts > $end1 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -120,14 +120,14 @@ if $rows != 0 then
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 sql select * from $tb where ts < $start3 and ts > $end1
print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 sql select * from $tb where ts < $start3 and ts > $end2
print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -136,7 +136,7 @@ if $rows != 0 then
return -1 return -1
endi endi
print ================= order by ts desc print ================= order by ts desc
sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc sql select * from $tb where ts < $start1 and ts > $end1 order by ts desc
if $rows != 0 then if $rows != 0 then
@ -153,9 +153,9 @@ if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc sql select * from $tb where ts < $start2 and ts > $end1 order by ts desc
print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points print select * from $tb where ts < $start2 and ts > $end1 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -169,15 +169,15 @@ if $rows != 0 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end1 order by ts desc -> $rows points
if $rows != $result2 then if $rows != $result2 then
return -1 return -1
endi endi
sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc
print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points print sql select * from $tb where ts < $start3 and ts > $end2 order by ts desc -> $rows points
if $rows != $result1 then if $rows != $result1 then
return -1 return -1
endi endi
@ -190,8 +190,8 @@ clear:
sql drop database $db sql drop database $db
sql select * from information_schema.ins_databases sql select * from information_schema.ins_databases
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -15,18 +15,18 @@ step1:
sql create database $db sql create database $db
sql use $db sql use $db
sql create table $tb (ts timestamp, speed int) sql create table $tb (ts timestamp, speed int)
$N = 20000 $N = 20000
$x = 0 $x = 0
while $x < $N while $x < $N
$ms = $x . s $ms = $x . s
#print insert into $tb values (now + $ms , $x ) #print insert into $tb values (now + $ms , $x )
sql insert into $tb values (now + $ms , $x ) -x error_insert sql insert into $tb values (now + $ms , $x ) -x error_insert
$x = $x + 1 $x = $x + 1
endw endw
error_insert: error_insert:
sql select * from $tb sql select * from $tb
@ -37,8 +37,8 @@ endi
sql drop database $db sql drop database $db
sql select * from information_schema.ins_databases sql select * from information_schema.ins_databases
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -21,8 +21,8 @@ while $x < 10000
$ms = $x . s $ms = $x . s
sql insert into tb values (now + $ms , '1' ) sql insert into tb values (now + $ms , '1' )
$x = $x + 1 $x = $x + 1
endw endw
sql select * from tb sql select * from tb
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -11,7 +11,7 @@ print =============== create super table
sql create table if not exists stb (ts timestamp, c1 int) tags (city binary(20),district binary(20)); sql create table if not exists stb (ts timestamp, c1 int) tags (city binary(20),district binary(20));
sql show stables sql show stables
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
@ -20,7 +20,7 @@ sql create table ct1 using stb tags("BeiJing", "ChaoYang")
sql create table ct2 using stb tags("BeiJing", "HaiDian") sql create table ct2 using stb tags("BeiJing", "HaiDian")
sql show tables sql show tables
if $rows != 2 then if $rows != 2 then
return -1 return -1
endi endi
@ -43,7 +43,7 @@ print $data30 $data31
print $data40 $data41 print $data40 $data41
print $data50 $data51 print $data50 $data51
if $rows != 6 then if $rows != 6 then
print rows $rows != 6 print rows $rows != 6
return -1 return -1
endi endi
@ -74,7 +74,7 @@ print $data00 $data01
print $data10 $data11 print $data10 $data11
print $data20 $data21 print $data20 $data21
if $rows != 3 then if $rows != 3 then
print rows $rows != 3 print rows $rows != 3
return -1 return -1
endi endi
@ -107,7 +107,7 @@ print $data30 $data31
print $data40 $data41 print $data40 $data41
print $data50 $data51 print $data50 $data51
if $rows != 6 then if $rows != 6 then
print rows $rows != 6 print rows $rows != 6
return -1 return -1
endi endi
@ -133,7 +133,7 @@ print $data00 $data01
print $data10 $data11 print $data10 $data11
print $data20 $data21 print $data20 $data21
if $rows != 3 then if $rows != 3 then
print rows $rows != 3 print rows $rows != 3
return -1 return -1
endi endi
@ -166,7 +166,7 @@ print $data30 $data31
print $data40 $data41 print $data40 $data41
print $data50 $data51 print $data50 $data51
if $rows != 6 then if $rows != 6 then
print rows $rows != 6 print rows $rows != 6
return -1 return -1
endi endi
@ -198,7 +198,7 @@ print $data20 $data21
print $data30 $data31 print $data30 $data31
print $data40 $data41 print $data40 $data41
if $rows != 5 then if $rows != 5 then
print rows $rows != 5 print rows $rows != 5
return -1 return -1
endi endi
@ -228,4 +228,4 @@ if $data41 != NULL then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT

View File

@ -13,7 +13,7 @@ print =============== create super table
sql create table if not exists stb (ts timestamp, c1 int unsigned, c2 double, c3 binary(10), c4 nchar(10), c5 double) tags (city binary(20),district binary(20)); sql create table if not exists stb (ts timestamp, c1 int unsigned, c2 double, c3 binary(10), c4 nchar(10), c5 double) tags (city binary(20),district binary(20));
sql show stables sql show stables
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
@ -24,7 +24,7 @@ sql create table ct3 using stb tags("BeiJing", "PingGu")
sql create table ct4 using stb tags("BeiJing", "YanQing") sql create table ct4 using stb tags("BeiJing", "YanQing")
sql show tables sql show tables
if $rows != 4 then if $rows != 4 then
print rows $rows != 4 print rows $rows != 4
return -1 return -1
endi endi
@ -69,7 +69,7 @@ print $data30 $data31 $data32 $data33 $data34 $data35
print $data40 $data41 $data42 $data43 $data44 $data45 print $data40 $data41 $data42 $data43 $data44 $data45
print $data50 $data51 $data52 $data53 $data54 $data55 print $data50 $data51 $data52 $data53 $data54 $data55
if $rows != 6 then if $rows != 6 then
print rows $rows != 6 print rows $rows != 6
return -1 return -1
endi endi
@ -154,7 +154,7 @@ print =============== step 6 query records of ct2 from memory(taosc and taosd me
sql select * from ct2; sql select * from ct2;
print $data00 $data01 $data02 $data03 $data04 $data05 print $data00 $data01 $data02 $data03 $data04 $data05
if $rows != 1 then if $rows != 1 then
print rows $rows != 1 print rows $rows != 1
return -1 return -1
endi endi
@ -196,12 +196,12 @@ print $data60 $data61 $data62 $data63 $data64 $data65
print $data70 $data71 $data72 $data73 $data74 $data75 print $data70 $data71 $data72 $data73 $data74 $data75
print $data80 $data81 $data82 $data83 $data84 $data85 print $data80 $data81 $data82 $data83 $data84 $data85
print $data90 $data91 $data92 $data93 $data94 $data95 print $data90 $data91 $data92 $data93 $data94 $data95
print $data[10][0] $data[10][1] $data[10][2] $data[10][3] $data[10][4] $data[10][5] print $data[10][0] $data[10][1] $data[10][2] $data[10][3] $data[10][4] $data[10][5]
print $data[11][0] $data[11][1] $data[11][2] $data[11][3] $data[11][4] $data[11][5] print $data[11][0] $data[11][1] $data[11][2] $data[11][3] $data[11][4] $data[11][5]
print $data[12][0] $data[12][1] $data[12][2] $data[12][3] $data[12][4] $data[12][5] print $data[12][0] $data[12][1] $data[12][2] $data[12][3] $data[12][4] $data[12][5]
print $data[13][0] $data[13][1] $data[13][2] $data[13][3] $data[13][4] $data[13][5] print $data[13][0] $data[13][1] $data[13][2] $data[13][3] $data[13][4] $data[13][5]
if $rows != 14 then if $rows != 14 then
print rows $rows != 14 print rows $rows != 14
return -1 return -1
endi endi
@ -356,7 +356,7 @@ print $data30 $data31 $data32 $data33 $data34 $data35
print $data40 $data41 $data42 $data43 $data44 $data45 print $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then if $rows != 5 then
print rows $rows != 5 print rows $rows != 5
return -1 return -1
endi endi
@ -451,7 +451,7 @@ print $data30 $data31 $data32 $data33 $data34 $data35
print $data40 $data41 $data42 $data43 $data44 $data45 print $data40 $data41 $data42 $data43 $data44 $data45
print $data50 $data51 $data52 $data53 $data54 $data55 print $data50 $data51 $data52 $data53 $data54 $data55
if $rows != 6 then if $rows != 6 then
print rows $rows != 6 print rows $rows != 6
return -1 return -1
endi endi
@ -536,7 +536,7 @@ print =============== step 10 query records of ct2 from file
sql select * from ct2; sql select * from ct2;
print $data00 $data01 $data02 $data03 $data04 $data05 print $data00 $data01 $data02 $data03 $data04 $data05
if $rows != 1 then if $rows != 1 then
print rows $rows != 1 print rows $rows != 1
return -1 return -1
endi endi
@ -578,12 +578,12 @@ print $data60 $data61 $data62 $data63 $data64 $data65
print $data70 $data71 $data72 $data73 $data74 $data75 print $data70 $data71 $data72 $data73 $data74 $data75
print $data80 $data81 $data82 $data83 $data84 $data85 print $data80 $data81 $data82 $data83 $data84 $data85
print $data90 $data91 $data92 $data93 $data94 $data95 print $data90 $data91 $data92 $data93 $data94 $data95
print $data[10][0] $data[10][1] $data[10][2] $data[10][3] $data[10][4] $data[10][5] print $data[10][0] $data[10][1] $data[10][2] $data[10][3] $data[10][4] $data[10][5]
print $data[11][0] $data[11][1] $data[11][2] $data[11][3] $data[11][4] $data[11][5] print $data[11][0] $data[11][1] $data[11][2] $data[11][3] $data[11][4] $data[11][5]
print $data[12][0] $data[12][1] $data[12][2] $data[12][3] $data[12][4] $data[12][5] print $data[12][0] $data[12][1] $data[12][2] $data[12][3] $data[12][4] $data[12][5]
print $data[13][0] $data[13][1] $data[13][2] $data[13][3] $data[13][4] $data[13][5] print $data[13][0] $data[13][1] $data[13][2] $data[13][3] $data[13][4] $data[13][5]
if $rows != 14 then if $rows != 14 then
print rows $rows != 14 print rows $rows != 14
return -1 return -1
endi endi
@ -738,7 +738,7 @@ print $data30 $data31 $data32 $data33 $data34 $data35
print $data40 $data41 $data42 $data43 $data44 $data45 print $data40 $data41 $data42 $data43 $data44 $data45
if $rows != 5 then if $rows != 5 then
print rows $rows != 5 print rows $rows != 5
return -1 return -1
endi endi
@ -818,4 +818,4 @@ if $data44 != n8 then
return -1 return -1
endi endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT