fix test cases
This commit is contained in:
parent
72d6802231
commit
19ab8ba58c
|
@ -2,7 +2,7 @@ This file contains a brief info about the parser test scripts directory.
|
|||
|
||||
The directory contains scripts for TDengine parser testing, mainly focus on syntax parsing and datatype support. The tests are organized in the way database languages are catagorized.
|
||||
|
||||
DML:
|
||||
DML:
|
||||
{
|
||||
SELECT
|
||||
INSERT
|
||||
|
|
|
@ -40,7 +40,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 30240m,30240m,30240m then
|
||||
if $data27 != 30240m,30240m,30240m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 11,12
|
||||
|
@ -48,7 +48,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 15840m,17280m,17280m then
|
||||
if $data27 != 15840m,17280m,17280m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 20,20,20
|
||||
|
@ -56,7 +56,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 28800m,28800m,28800m then
|
||||
if $data27 != 28800m,28800m,28800m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 10,10,10
|
||||
|
@ -64,7 +64,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 14400m,14400m,14400m then
|
||||
if $data27 != 14400m,14400m,14400m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 10,10,11
|
||||
|
@ -72,7 +72,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 14400m,14400m,15840m then
|
||||
if $data27 != 14400m,14400m,15840m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 11,12,13
|
||||
|
@ -80,7 +80,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 15840m,17280m,18720m then
|
||||
if $data27 != 15840m,17280m,18720m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 365000,365000,365000
|
||||
|
@ -88,7 +88,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 525600000m,525600000m,525600000m then
|
||||
if $data27 != 525600000m,525600000m,525600000m then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -100,11 +100,11 @@ if $rows != 1 then
|
|||
return -1
|
||||
endi
|
||||
sql alter table tb drop column c3
|
||||
sql select * from tb order by ts desc
|
||||
sql select * from tb order by ts desc
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
if $data02 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != null then
|
||||
|
@ -136,10 +136,10 @@ sql create table tb using mt tags(1)
|
|||
sql insert into tb values (now, 1, 1, 1)
|
||||
sql alter table mt drop column c3
|
||||
sql select * from tb order by ts desc
|
||||
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
|
||||
|
@ -243,7 +243,7 @@ if $data02 != null then
|
|||
endi
|
||||
sql alter table mt add column c2 int
|
||||
sql insert into tb (ts, c2) values (now, 3)
|
||||
sql select * from tb order by ts desc
|
||||
sql select * from tb order by ts desc
|
||||
if $data02 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -268,7 +268,7 @@ if $data02 != insert then
|
|||
return -1
|
||||
endi
|
||||
sql alter table mt add column c3 nchar(4)
|
||||
sql select * from tb order by ts desc
|
||||
sql select * from tb order by ts desc
|
||||
if $data03 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
@ -283,7 +283,7 @@ sql insert into tb(ts, c1, c3) using mt(t1) tags(123) values('2018-11-01 16:29:5
|
|||
sql insert into tb values ('2018-11-01 16:29:58.000', 2, 'import', 3)
|
||||
sql import into tb values ('2018-11-01 16:29:58.000', 2, 'import', 3)
|
||||
sql import into tb values ('2018-11-01 16:39:58.000', 2, 'import', 3)
|
||||
sql select * from tb order by ts desc
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -23,7 +23,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 28800m,28800m,28800m then
|
||||
if $data27 != 28800m,28800m,28800m then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -49,7 +49,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 28800m,28800m,28800m then
|
||||
if $data27 != 28800m,28800m,28800m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 10
|
||||
|
@ -57,7 +57,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 14400m,14400m,14400m then
|
||||
if $data27 != 14400m,14400m,14400m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 11
|
||||
|
@ -65,7 +65,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 15840m,15840m,15840m then
|
||||
if $data27 != 15840m,15840m,15840m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 13
|
||||
|
@ -73,7 +73,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 18720m,18720m,18720m then
|
||||
if $data27 != 18720m,18720m,18720m then
|
||||
return -1
|
||||
endi
|
||||
sql alter database $db keep 365000
|
||||
|
@ -81,7 +81,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 525600000m,525600000m,525600000m then
|
||||
if $data27 != 525600000m,525600000m,525600000m then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -94,11 +94,11 @@ if $rows != 1 then
|
|||
return -1
|
||||
endi
|
||||
sql alter table tb drop column c3
|
||||
sql select * from tb order by ts desc
|
||||
sql select * from tb order by ts desc
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
if $data02 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != null then
|
||||
|
@ -130,10 +130,10 @@ sql create table tb using mt tags(1)
|
|||
sql insert into tb values (now, 1, 1, 1)
|
||||
sql alter table mt drop column c3
|
||||
sql select * from tb order by ts desc
|
||||
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
|
||||
|
@ -231,7 +231,7 @@ if $data02 != null then
|
|||
endi
|
||||
sql alter table mt add column c2 int
|
||||
sql insert into tb (ts, c2) values (now, 3)
|
||||
sql select * from tb order by ts desc
|
||||
sql select * from tb order by ts desc
|
||||
if $data02 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -255,7 +255,7 @@ if $data02 != insert then
|
|||
return -1
|
||||
endi
|
||||
sql alter table mt add column c3 nchar(4)
|
||||
sql select * from tb order by ts desc
|
||||
sql select * from tb order by ts desc
|
||||
if $data03 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
@ -270,7 +270,7 @@ sql insert into tb(ts, c1, c3) using mt(t1) tags(123) values('2018-11-01 16:29:5
|
|||
sql insert into tb values ('2018-11-01 16:29:58.000', 2, 'import', 3)
|
||||
sql import into tb values ('2018-11-01 16:29:58.000', 2, 'import', 3)
|
||||
sql import into tb values ('2018-11-01 16:39:58.000', 2, 'import', 3)
|
||||
sql select * from tb order by ts desc
|
||||
sql select * from tb order by ts desc
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -35,7 +35,7 @@ sql alter table tb1 set tag len = 379
|
|||
# case TD-5594
|
||||
sql create stable st5520(ts timestamp, f int) tags(t0 bool, t1 nchar(4093), t2 nchar(1))
|
||||
sql alter stable st5520 modify tag t2 nchar(2);
|
||||
# test end
|
||||
# test end
|
||||
sql drop database $db
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -30,12 +30,12 @@ sql show stables
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != $stb then
|
||||
if $data00 != $stb then
|
||||
return -1
|
||||
endi
|
||||
|
||||
### create table on the fly
|
||||
sql insert into tb1 using $stb tags (1) values ( $ts0 , 1,1,1,1,'bin',1,1,1,'涛思数据')
|
||||
sql insert into tb1 using $stb tags (1) values ( $ts0 , 1,1,1,1,'bin',1,1,1,'涛思数据')
|
||||
sql select * from tb1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
|
@ -184,7 +184,7 @@ if $data(3)[8] != 涛思数据3 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select t1, count(*), first(c9) from $stb partition by t1 order by t1 asc slimit 3
|
||||
sql select t1, count(*), first(c9) from $stb partition by t1 order by t1 asc slimit 3
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -251,7 +251,7 @@ if $data(3)[8] != 涛思数据3 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select t1, count(*), first(c9) from $stb partition by t1 order by t1 asc slimit 3
|
||||
sql select t1, count(*), first(c9) from $stb partition by t1 order by t1 asc slimit 3
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -290,7 +290,7 @@ endi
|
|||
|
||||
#sql drop database $db
|
||||
#sql show databases
|
||||
#if $rows != 0 then
|
||||
#if $rows != 0 then
|
||||
# return -1
|
||||
#endi
|
||||
|
||||
|
@ -305,4 +305,4 @@ 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
|
||||
|
|
|
@ -37,9 +37,9 @@ while $t < $tbNum
|
|||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
$ts = $ts0 + $xs
|
||||
sql insert into $tbname using $stb tags( $t1 ) values ( $ts , $x )
|
||||
sql insert into $tbname using $stb tags( $t1 ) values ( $ts , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
$t = $t + 1
|
||||
$x = 0
|
||||
endw
|
||||
|
@ -47,11 +47,11 @@ print ====== tables created
|
|||
|
||||
sql drop table tb2
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
while $x < $rowNum
|
||||
$ts = $ts + $delta
|
||||
$t1 = 'tb . $t
|
||||
$t1 = $t1 . '
|
||||
sql insert into tb1 using $stb tags( $t1 ) values ( $ts , $x )
|
||||
sql insert into tb1 using $stb tags( $t1 ) values ( $ts , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
|
@ -62,7 +62,7 @@ $x = 0
|
|||
while $x < 100
|
||||
$ts = $ts + $delta
|
||||
sql insert into tb2 using stb0 tags('tb2') values ( $ts , 1)
|
||||
sql select * from tb2
|
||||
sql select * from tb2
|
||||
$res = $x + 1
|
||||
if $rows != $res then
|
||||
return -1
|
||||
|
@ -74,4 +74,4 @@ while $x < 100
|
|||
print loop $x
|
||||
endw
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -13,7 +13,7 @@ sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
|
|||
sql create table tb2 using st2 tags (2,2.0,"2",2.0,2,2,"2");
|
||||
sql create table tb3 using st2 tags (3,3.0,"3",3.0,3,3,"3");
|
||||
sql create table tb4 using st2 tags (4,4.0,"4",4.0,4,4,"4");
|
||||
|
||||
|
||||
sql insert into tb1 values (now-200s,1,1.0,1.0,1,1,1,true,"1","1")
|
||||
sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true,"2","2")
|
||||
sql insert into tb1 values (now,3,3.0,3.0,3,3,3,true,"3","3")
|
||||
|
@ -47,16 +47,16 @@ sql select tbname, id2 from st2 where id2 between 0.0 and 3.0;
|
|||
if $rows != 7 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb2)[0] != tb2 then
|
||||
if $data(tb2)[0] != tb2 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb2)[1] != 2.00000 then
|
||||
if $data(tb2)[1] != 2.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb3)[0] != tb3 then
|
||||
if $data(tb3)[0] != tb3 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb3)[1] != 3.00000 then
|
||||
if $data(tb3)[1] != 3.00000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -64,16 +64,16 @@ sql select tbname, id4 from st2 where id2 between 2.0 and 3.0;
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb2)[0] != tb2 then
|
||||
if $data(tb2)[0] != tb2 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb2)[1] != 2.000000000 then
|
||||
if $data(tb2)[1] != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb3)[0] != tb3 then
|
||||
if $data(tb3)[0] != tb3 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb3)[1] != 3.000000000 then
|
||||
if $data(tb3)[1] != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -81,16 +81,16 @@ sql select tbname, id5 from st2 where id5 between 2.0 and 3.0;
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb2)[0] != tb2 then
|
||||
if $data(tb2)[0] != tb2 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb2)[1] != 2 then
|
||||
if $data(tb2)[1] != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb3)[0] != tb3 then
|
||||
if $data(tb3)[0] != tb3 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb3)[1] != 3 then
|
||||
if $data(tb3)[1] != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -98,16 +98,16 @@ sql select tbname,id6 from st2 where id6 between 2.0 and 3.0;
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb2)[0] != tb2 then
|
||||
if $data(tb2)[0] != tb2 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb2)[1] != 2 then
|
||||
if $data(tb2)[1] != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb3)[0] != tb3 then
|
||||
if $data(tb3)[0] != tb3 then
|
||||
return -1
|
||||
endi
|
||||
if $data(tb3)[1] != 3 then
|
||||
if $data(tb3)[1] != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -115,10 +115,10 @@ sql select * from st2 where f1 between 2 and 3 and f2 between 2.0 and 3.0 and f3
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 3 then
|
||||
if $data11 != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ sql use db
|
|||
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
|
||||
|
||||
######## case 0: bigint
|
||||
print ========== bigint
|
||||
print ========== bigint
|
||||
sql create table mt_bigint (ts timestamp, c bigint) tags (tagname bigint)
|
||||
|
||||
## case 00: static create table for test tag values
|
||||
|
@ -86,7 +86,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_1 values (now, NULL)
|
||||
sql select * from st_bigint_1
|
||||
if $rows != 1 then
|
||||
|
@ -94,7 +94,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql insert into st_bigint_6 values (now, 9223372036854775807)
|
||||
sql select * from st_bigint_6
|
||||
|
@ -103,7 +103,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 9223372036854775807 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_7 values (now, -9223372036854775807)
|
||||
sql select * from st_bigint_7
|
||||
if $rows != 1 then
|
||||
|
@ -111,15 +111,15 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -9223372036854775807 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_bigint_8 values (now, +100)
|
||||
endi
|
||||
sql insert into st_bigint_8 values (now, +100)
|
||||
sql select * from st_bigint_8
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 100 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_9 values (now, "-098")
|
||||
sql select * from st_bigint_9
|
||||
if $rows != 1 then
|
||||
|
@ -127,7 +127,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -98 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_10 values (now, '0')
|
||||
sql select * from st_bigint_10
|
||||
if $rows != 1 then
|
||||
|
@ -135,15 +135,15 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_bigint_11 values (now, -0)
|
||||
endi
|
||||
sql insert into st_bigint_11 values (now, -0)
|
||||
sql select * from st_bigint_11
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_12 values (now, "+056")
|
||||
sql select * from st_bigint_12
|
||||
if $rows != 1 then
|
||||
|
@ -151,7 +151,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql insert into st_bigint_13 values (now, +056)
|
||||
sql select * from st_bigint_13
|
||||
|
@ -160,7 +160,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql insert into st_bigint_14 values (now, -056)
|
||||
sql select * from st_bigint_14
|
||||
|
@ -169,7 +169,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
## case 02: dynamic create table for test tag values
|
||||
sql insert into st_bigint_16 using mt_bigint tags (NULL) values (now, NULL)
|
||||
|
@ -181,7 +181,7 @@ sql select * from st_bigint_16
|
|||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql insert into st_bigint_17 using mt_bigint tags (NULL) values (now, NULL)
|
||||
sql show tags from st_bigint_17
|
||||
if $data05 != NULL then
|
||||
|
@ -190,7 +190,7 @@ endi
|
|||
sql select * from st_bigint_17
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_18 using mt_bigint tags ('NULL') values (now, 'NULL')
|
||||
sql show tags from st_bigint_18
|
||||
if $data05 != NULL then
|
||||
|
@ -235,7 +235,7 @@ endi
|
|||
sql select * from st_bigint_22
|
||||
if $data01 != 9223372036854775807 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_23 using mt_bigint tags (-9223372036854775807) values (now, -9223372036854775807)
|
||||
sql show tags from st_bigint_23
|
||||
if $data05 != -9223372036854775807 then
|
||||
|
@ -244,7 +244,7 @@ endi
|
|||
sql select * from st_bigint_23
|
||||
if $data01 != -9223372036854775807 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_24 using mt_bigint tags (10) values (now, 10)
|
||||
sql show tags from st_bigint_24
|
||||
if $data05 != 10 then
|
||||
|
@ -253,7 +253,7 @@ endi
|
|||
sql select * from st_bigint_24
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_25 using mt_bigint tags ("-0") values (now, "-0")
|
||||
sql show tags from st_bigint_25
|
||||
if $data05 != 0 then
|
||||
|
@ -262,7 +262,7 @@ endi
|
|||
sql select * from st_bigint_25
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_26 using mt_bigint tags ('123') values (now, '123')
|
||||
sql show tags from st_bigint_26
|
||||
if $data05 != 123 then
|
||||
|
@ -271,7 +271,7 @@ endi
|
|||
sql select * from st_bigint_26
|
||||
if $data01 != 123 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_27 using mt_bigint tags (+056) values (now, +00056)
|
||||
sql show tags from st_bigint_27
|
||||
if $data05 != 56 then
|
||||
|
@ -280,7 +280,7 @@ endi
|
|||
sql select * from st_bigint_27
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bigint_28 using mt_bigint tags (-056) values (now, -0056)
|
||||
sql show tags from st_bigint_28
|
||||
if $data05 != -56 then
|
||||
|
@ -289,7 +289,7 @@ endi
|
|||
sql select * from st_bigint_28
|
||||
if $data01 != -56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
### case 03: alter tag values
|
||||
#sql alter table st_bigint_0 set tag tagname=9223372036854775807
|
||||
|
@ -341,12 +341,12 @@ sql_error create table st_bigint_e0_2 using mt_bigint tags (92233720368547758080
|
|||
sql_error create table st_bigint_e0_3 using mt_bigint tags (-9223372036854775809)
|
||||
#sql_error create table st_bigint_e0 using mt_bigint tags (12.80) truncate integer part
|
||||
#sql_error create table st_bigint_e0 using mt_bigint tags (-11.80)
|
||||
sql_error create table st_bigint_e0 using mt_bigint tags (123abc)
|
||||
sql_error create table st_bigint_e0 using mt_bigint tags (123abc)
|
||||
sql_error create table st_bigint_e0 using mt_bigint tags ("123abc")
|
||||
sql_error create table st_bigint_e0 using mt_bigint tags (abc)
|
||||
sql_error create table st_bigint_e0 using mt_bigint tags ("abc")
|
||||
sql_error create table st_bigint_e0 using mt_bigint tags (" ")
|
||||
sql create table st_bigint_e0_error using mt_bigint tags ('')
|
||||
sql_error create table st_bigint_e0 using mt_bigint tags (abc)
|
||||
sql_error create table st_bigint_e0 using mt_bigint tags ("abc")
|
||||
sql_error create table st_bigint_e0 using mt_bigint tags (" ")
|
||||
sql create table st_bigint_e0_error using mt_bigint tags ('')
|
||||
|
||||
sql create table st_bigint_e0 using mt_bigint tags (123)
|
||||
sql create table st_bigint_e1 using mt_bigint tags (123)
|
||||
|
@ -362,31 +362,31 @@ sql create table st_bigint_e10 using mt_bigint tags (123)
|
|||
sql create table st_bigint_e11 using mt_bigint tags (123)
|
||||
sql create table st_bigint_e12 using mt_bigint tags (123)
|
||||
|
||||
sql_error insert into st_bigint_e0 values (now, 9223372036854775808)
|
||||
sql insert into st_bigint_e1 values (now, -9223372036854775808)
|
||||
sql_error insert into st_bigint_e2 values (now, 9223372036854775809)
|
||||
sql insert into st_bigint_e3 values (now, -9223372036854775808)
|
||||
#sql_error insert into st_bigint_e4 values (now, 922337203.6854775808)
|
||||
#sql_error insert into st_bigint_e5 values (now, -922337203685477580.9)
|
||||
sql_error insert into st_bigint_e6 values (now, 123abc)
|
||||
sql_error insert into st_bigint_e0 values (now, 9223372036854775808)
|
||||
sql insert into st_bigint_e1 values (now, -9223372036854775808)
|
||||
sql_error insert into st_bigint_e2 values (now, 9223372036854775809)
|
||||
sql insert into st_bigint_e3 values (now, -9223372036854775808)
|
||||
#sql_error insert into st_bigint_e4 values (now, 922337203.6854775808)
|
||||
#sql_error insert into st_bigint_e5 values (now, -922337203685477580.9)
|
||||
sql_error insert into st_bigint_e6 values (now, 123abc)
|
||||
sql_error insert into st_bigint_e7 values (now, "123abc")
|
||||
sql_error insert into st_bigint_e9 values (now, abc)
|
||||
sql_error insert into st_bigint_e10 values (now, "abc")
|
||||
sql_error insert into st_bigint_e11 values (now, " ")
|
||||
sql insert into st_bigint_e12 values (now, '')
|
||||
sql_error insert into st_bigint_e9 values (now, abc)
|
||||
sql_error insert into st_bigint_e10 values (now, "abc")
|
||||
sql_error insert into st_bigint_e11 values (now, " ")
|
||||
sql insert into st_bigint_e12 values (now, '')
|
||||
|
||||
sql_error insert into st_bigint_e13 using mt_bigint tags (033) values (now, 9223372036854775808)
|
||||
sql insert into st_bigint_e14 using mt_bigint tags (033) values (now, -9223372036854775808)
|
||||
sql_error insert into st_bigint_e15 using mt_bigint tags (033) values (now, 9223372036854775818)
|
||||
sql_error insert into st_bigint_e16 using mt_bigint tags (033) values (now, -9923372036854775808)
|
||||
#sql_error insert into st_bigint_e17 using mt_bigint tags (033) values (now, 92233720368547758.08)
|
||||
#sql_error insert into st_bigint_e18 using mt_bigint tags (033) values (now, -92233720368547.75808)
|
||||
sql_error insert into st_bigint_e19 using mt_bigint tags (033) values (now, 123abc)
|
||||
sql_error insert into st_bigint_e13 using mt_bigint tags (033) values (now, 9223372036854775808)
|
||||
sql insert into st_bigint_e14 using mt_bigint tags (033) values (now, -9223372036854775808)
|
||||
sql_error insert into st_bigint_e15 using mt_bigint tags (033) values (now, 9223372036854775818)
|
||||
sql_error insert into st_bigint_e16 using mt_bigint tags (033) values (now, -9923372036854775808)
|
||||
#sql_error insert into st_bigint_e17 using mt_bigint tags (033) values (now, 92233720368547758.08)
|
||||
#sql_error insert into st_bigint_e18 using mt_bigint tags (033) values (now, -92233720368547.75808)
|
||||
sql_error insert into st_bigint_e19 using mt_bigint tags (033) values (now, 123abc)
|
||||
sql_error insert into st_bigint_e20 using mt_bigint tags (033) values (now, "123abc")
|
||||
sql_error insert into st_bigint_e22 using mt_bigint tags (033) values (now, abc)
|
||||
sql_error insert into st_bigint_e23 using mt_bigint tags (033) values (now, "abc")
|
||||
sql_error insert into st_bigint_e24 using mt_bigint tags (033) values (now, " ")
|
||||
sql insert into st_bigint_e25 using mt_bigint tags (033) values (now, '')
|
||||
sql_error insert into st_bigint_e22 using mt_bigint tags (033) values (now, abc)
|
||||
sql_error insert into st_bigint_e23 using mt_bigint tags (033) values (now, "abc")
|
||||
sql_error insert into st_bigint_e24 using mt_bigint tags (033) values (now, " ")
|
||||
sql insert into st_bigint_e25 using mt_bigint tags (033) values (now, '')
|
||||
|
||||
sql_error insert into st_bigint_e13_0 using mt_bigint tags (9223372036854775808) values (now, -033)
|
||||
sql insert into st_bigint_e14_0 using mt_bigint tags (-9223372036854775808) values (now, -033)
|
||||
|
@ -426,4 +426,4 @@ sql insert into st_bigint_e25 using mt_bigint tags (033) values (now, 00062)
|
|||
#sql_error alter table st_bigint_e24 set tag tagname=" "
|
||||
#sql_error alter table st_bigint_e25 set tag tagname=''
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -12,7 +12,7 @@ sql use db
|
|||
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
|
||||
|
||||
######## case 0: bool
|
||||
print ========== bool
|
||||
print ========== bool
|
||||
sql create table mt_bool (ts timestamp, c bool) tags (tagname bool)
|
||||
|
||||
## case 00: static create table for test tag values
|
||||
|
@ -134,7 +134,7 @@ endi
|
|||
if $data01 != NULL then
|
||||
print ==17== expect: NULL, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_1 values (now, NULL)
|
||||
sql select * from st_bool_1
|
||||
if $rows != 1 then
|
||||
|
@ -143,7 +143,7 @@ endi
|
|||
if $data01 != NULL then
|
||||
print ==18== expect: NULL, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_2 values (now, 'NULL')
|
||||
sql select * from st_bool_2
|
||||
if $rows != 1 then
|
||||
|
@ -188,7 +188,7 @@ endi
|
|||
if $data01 != 1 then
|
||||
print ==23== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_7 values (now, 'true')
|
||||
sql select * from st_bool_7
|
||||
if $rows != 1 then
|
||||
|
@ -197,8 +197,8 @@ endi
|
|||
if $data01 != 1 then
|
||||
print ==24== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_bool_8 values (now, true)
|
||||
endi
|
||||
sql insert into st_bool_8 values (now, true)
|
||||
sql select * from st_bool_8
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
|
@ -206,7 +206,7 @@ endi
|
|||
if $data01 != 1 then
|
||||
print ==25== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_9 values (now, "false")
|
||||
sql select * from st_bool_9
|
||||
if $rows != 1 then
|
||||
|
@ -215,7 +215,7 @@ endi
|
|||
if $data01 != 0 then
|
||||
print ==26== expect: false, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_10 values (now, 'false')
|
||||
sql select * from st_bool_10
|
||||
if $rows != 1 then
|
||||
|
@ -224,8 +224,8 @@ endi
|
|||
if $data01 != 0 then
|
||||
print ==27== expect: false, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_bool_11 values (now, false)
|
||||
endi
|
||||
sql insert into st_bool_11 values (now, false)
|
||||
sql select * from st_bool_11
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
|
@ -233,7 +233,7 @@ endi
|
|||
if $data01 != 0 then
|
||||
print ==28== expect: false, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_12 values (now, 0)
|
||||
sql select * from st_bool_12
|
||||
if $rows != 1 then
|
||||
|
@ -242,7 +242,7 @@ endi
|
|||
if $data01 != 0 then
|
||||
print ==29== expect: false, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_13 values (now, 1)
|
||||
sql select * from st_bool_13
|
||||
if $rows != 1 then
|
||||
|
@ -251,7 +251,7 @@ endi
|
|||
if $data01 != 1 then
|
||||
print ==30== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_14 values (now, 6.9)
|
||||
sql select * from st_bool_14
|
||||
if $rows != 1 then
|
||||
|
@ -260,8 +260,8 @@ endi
|
|||
if $data01 != 1 then
|
||||
print ==31== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_bool_15 values (now, -3)
|
||||
endi
|
||||
sql insert into st_bool_15 values (now, -3)
|
||||
sql select * from st_bool_15
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
|
@ -269,8 +269,8 @@ endi
|
|||
if $data01 != 1 then
|
||||
print ==32== expect: true, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_bool_15_0 values (now, +300)
|
||||
endi
|
||||
sql insert into st_bool_15_0 values (now, +300)
|
||||
sql select * from st_bool_15_0
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
|
@ -278,8 +278,8 @@ endi
|
|||
if $data01 != 1 then
|
||||
print ==32== expect: true, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_bool_15_1 values (now, -3.15)
|
||||
endi
|
||||
sql insert into st_bool_15_1 values (now, -3.15)
|
||||
sql select * from st_bool_15_1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
|
@ -287,7 +287,7 @@ endi
|
|||
if $data01 != 1 then
|
||||
print ==32== expect: true, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
## case 02: dynamic create table for test tag values
|
||||
sql insert into st_bool_16 using mt_bool tags (NULL) values (now, NULL)
|
||||
|
@ -301,7 +301,7 @@ if $data01 != NULL then
|
|||
print ==34== expect: NULL, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql insert into st_bool_17 using mt_bool tags (NULL) values (now, NULL)
|
||||
sql show tags from st_bool_17
|
||||
if $data05 != NULL then
|
||||
|
@ -312,7 +312,7 @@ sql select * from st_bool_17
|
|||
if $data01 != NULL then
|
||||
print ==36== expect: NULL, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_18 using mt_bool tags ('NULL') values (now, 'NULL')
|
||||
sql show tags from st_bool_18
|
||||
if $data05 != NULL then
|
||||
|
@ -367,7 +367,7 @@ sql select * from st_bool_22
|
|||
if $data01 != 1 then
|
||||
print ==46== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_23 using mt_bool tags ('true') values (now, 'true')
|
||||
sql show tags from st_bool_23
|
||||
if $data05 != true then
|
||||
|
@ -378,7 +378,7 @@ sql select * from st_bool_23
|
|||
if $data01 != 1 then
|
||||
print ==48== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_24 using mt_bool tags (true) values (now, true)
|
||||
sql show tags from st_bool_24
|
||||
if $data05 != true then
|
||||
|
@ -389,7 +389,7 @@ sql select * from st_bool_24
|
|||
if $data01 != 1 then
|
||||
print ==50== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_25 using mt_bool tags ("false") values (now, "false")
|
||||
sql show tags from st_bool_25
|
||||
if $data05 != false then
|
||||
|
@ -400,7 +400,7 @@ sql select * from st_bool_25
|
|||
if $data01 != 0 then
|
||||
print ==52== expect: 0, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_26 using mt_bool tags ('false') values (now, 'false')
|
||||
sql show tags from st_bool_26
|
||||
if $data05 != false then
|
||||
|
@ -411,7 +411,7 @@ sql select * from st_bool_26
|
|||
if $data01 != 0 then
|
||||
print ==54== expect: 0, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_27 using mt_bool tags (false) values (now, false)
|
||||
sql show tags from st_bool_27
|
||||
if $data05 != false then
|
||||
|
@ -422,7 +422,7 @@ sql select * from st_bool_27
|
|||
if $data01 != 0 then
|
||||
print ==56== expect: 0, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_28 using mt_bool tags (0) values (now, 0)
|
||||
sql show tags from st_bool_28
|
||||
if $data05 != false then
|
||||
|
@ -433,8 +433,8 @@ sql select * from st_bool_28
|
|||
if $data01 != 0 then
|
||||
print ==58== expect: 0, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_bool_29 using mt_bool tags (1) values (now, 1)
|
||||
endi
|
||||
sql insert into st_bool_29 using mt_bool tags (1) values (now, 1)
|
||||
sql show tags from st_bool_29
|
||||
if $data05 != true then
|
||||
print ==59== expect: 1, actually: $data00
|
||||
|
@ -444,7 +444,7 @@ sql select * from st_bool_29
|
|||
if $data01 != 1 then
|
||||
print ==60== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_30 using mt_bool tags (6.9) values (now, 6.9)
|
||||
sql show tags from st_bool_30
|
||||
if $data05 != true then
|
||||
|
@ -455,7 +455,7 @@ sql select * from st_bool_30
|
|||
if $data01 != 1 then
|
||||
print ==62== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_31 using mt_bool tags (-3) values (now, -3)
|
||||
sql show tags from st_bool_31
|
||||
if $data05 != true then
|
||||
|
@ -466,7 +466,7 @@ sql select * from st_bool_31
|
|||
if $data01 != 1 then
|
||||
print ==64== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_32 using mt_bool tags (+300) values (now, +300)
|
||||
sql show tags from st_bool_32
|
||||
if $data05 != true then
|
||||
|
@ -477,7 +477,7 @@ sql select * from st_bool_32
|
|||
if $data01 != 1 then
|
||||
print ==64== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_bool_33 using mt_bool tags (+30.890) values (now, +30.890)
|
||||
sql show tags from st_bool_33
|
||||
if $data05 != true then
|
||||
|
@ -488,7 +488,7 @@ sql select * from st_bool_33
|
|||
if $data01 != 1 then
|
||||
print ==64== expect: 1, actually: $data01
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
@ -610,13 +610,13 @@ sql_error insert into st_bool_h4 using mt_bool tags ("abc") values (now, 1)
|
|||
sql_error insert into st_bool_h5 using mt_bool tags (" ") values (now, 1)
|
||||
sql_error insert into st_bool_h6 using mt_bool tags ('') values (now, 1)
|
||||
|
||||
sql_error insert into st_bool_h0 using mt_bool tags (1) values (now, 123abc)
|
||||
sql_error insert into st_bool_h0 using mt_bool tags (1) values (now, 123abc)
|
||||
sql_error insert into st_bool_h1 using mt_bool tags (1) values (now, "123abc")
|
||||
sql_error insert into st_bool_h2 using mt_bool tags (1) values (now, "123")
|
||||
sql_error insert into st_bool_h3 using mt_bool tags (1) values (now, abc)
|
||||
sql_error insert into st_bool_h4 using mt_bool tags (1) values (now, "abc")
|
||||
sql_error insert into st_bool_h5 using mt_bool tags (1) values (now, " ")
|
||||
sql_error insert into st_bool_h6 using mt_bool tags (1) values (now, '')
|
||||
sql_error insert into st_bool_h2 using mt_bool tags (1) values (now, "123")
|
||||
sql_error insert into st_bool_h3 using mt_bool tags (1) values (now, abc)
|
||||
sql_error insert into st_bool_h4 using mt_bool tags (1) values (now, "abc")
|
||||
sql_error insert into st_bool_h5 using mt_bool tags (1) values (now, " ")
|
||||
sql_error insert into st_bool_h6 using mt_bool tags (1) values (now, '')
|
||||
|
||||
sql insert into st_bool_i0 using mt_bool tags (1) values (now, 1)
|
||||
sql insert into st_bool_i1 using mt_bool tags (1) values (now, 1)
|
||||
|
@ -626,12 +626,12 @@ sql insert into st_bool_i4 using mt_bool tags (1) values (now, 1)
|
|||
sql insert into st_bool_i5 using mt_bool tags (1) values (now, 1)
|
||||
sql insert into st_bool_i6 using mt_bool tags (1) values (now, 1)
|
||||
|
||||
sql_error alter table st_bool_i0 set tag tagname=123abc
|
||||
sql_error alter table st_bool_i0 set tag tagname=123abc
|
||||
sql alter table st_bool_i1 set tag tagname="123abc"
|
||||
sql alter table st_bool_i2 set tag tagname="123"
|
||||
sql_error alter table st_bool_i3 set tag tagname=abc
|
||||
sql alter table st_bool_i4 set tag tagname="abc"
|
||||
sql alter table st_bool_i5 set tag tagname=" "
|
||||
sql alter table st_bool_i6 set tag tagname=''
|
||||
sql alter table st_bool_i2 set tag tagname="123"
|
||||
sql_error alter table st_bool_i3 set tag tagname=abc
|
||||
sql alter table st_bool_i4 set tag tagname="abc"
|
||||
sql alter table st_bool_i5 set tag tagname=" "
|
||||
sql alter table st_bool_i6 set tag tagname=''
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -12,7 +12,7 @@ sql use db
|
|||
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
|
||||
|
||||
######## case 0: double
|
||||
print ========== double
|
||||
print ========== double
|
||||
sql create table mt_double (ts timestamp, c double) tags (tagname double)
|
||||
|
||||
## case 00: static create table for test tag values
|
||||
|
@ -157,7 +157,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_double_1 values (now, NULL)
|
||||
sql select * from st_double_1
|
||||
if $rows != 1 then
|
||||
|
@ -165,7 +165,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_double_2 values (now, 'NULL')
|
||||
sql select * from st_double_2
|
||||
if $rows != 1 then
|
||||
|
@ -204,10 +204,10 @@ sql select * from st_double_6
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
#if $data01 != 340282346638528859811704183484516925440.00000 then
|
||||
#if $data01 != 340282346638528859811704183484516925440.00000 then
|
||||
# print ==== data01:$data01, expect:340282346638528859811704183484516925440.00000
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_7 values (now, -1.7976931348623157e+308)
|
||||
sql select * from st_double_7
|
||||
if $rows != 1 then
|
||||
|
@ -215,15 +215,15 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != -340282346638528859811704183484516925440.00000 then
|
||||
# return -1
|
||||
#endi
|
||||
sql insert into st_double_8 values (now, +100.89)
|
||||
#endi
|
||||
sql insert into st_double_8 values (now, +100.89)
|
||||
sql select * from st_double_8
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
#if $data01 != 100.89000000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_9 values (now, "-0.98")
|
||||
sql select * from st_double_9
|
||||
if $rows != 1 then
|
||||
|
@ -231,7 +231,7 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != -0.980000000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_10 values (now, '0')
|
||||
sql select * from st_double_10
|
||||
if $rows != 1 then
|
||||
|
@ -239,15 +239,15 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != 0.00000000 then # tsim only print 4 bits after dot
|
||||
# return -1
|
||||
#endi
|
||||
sql insert into st_double_11 values (now, -0)
|
||||
#endi
|
||||
sql insert into st_double_11 values (now, -0)
|
||||
sql select * from st_double_11
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
#if $data01 != 0.000000000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_12 values (now, "+056")
|
||||
sql select * from st_double_12
|
||||
if $rows != 1 then
|
||||
|
@ -255,7 +255,7 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != 56.000000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
|
||||
sql insert into st_double_13 values (now, +056)
|
||||
sql select * from st_double_13
|
||||
|
@ -264,7 +264,7 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != 56.000000000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
|
||||
sql insert into st_double_14 values (now, -056)
|
||||
sql select * from st_double_14
|
||||
|
@ -273,7 +273,7 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != -56 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
|
||||
## case 02: dynamic create table for test tag values
|
||||
sql insert into st_double_16 using mt_double tags (NULL ) values (now, NULL )
|
||||
|
@ -285,7 +285,7 @@ sql select * from st_double_16
|
|||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql insert into st_double_17 using mt_double tags (NULL) values (now, NULL)
|
||||
sql show tags from st_double_17
|
||||
if $data05 != NULL then
|
||||
|
@ -294,7 +294,7 @@ endi
|
|||
sql select * from st_double_17
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_double_18 using mt_double tags ('NULL') values (now, 'NULL')
|
||||
sql show tags from st_double_18
|
||||
if $data05 != NULL then
|
||||
|
@ -339,7 +339,7 @@ sql show tags from st_double_22
|
|||
sql select * from st_double_22
|
||||
#if $data01 != 127 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_23 using mt_double tags (-127) values (now, -1.7976931348623157e+308)
|
||||
sql show tags from st_double_23
|
||||
#if $data05 != -127 then
|
||||
|
@ -348,7 +348,7 @@ sql show tags from st_double_23
|
|||
sql select * from st_double_23
|
||||
#if $data01 != -127 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_24 using mt_double tags (10) values (now, 10)
|
||||
sql show tags from st_double_24
|
||||
#if $data05 != 10 then
|
||||
|
@ -357,7 +357,7 @@ sql show tags from st_double_24
|
|||
sql select * from st_double_24
|
||||
#if $data01 != 10 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_25 using mt_double tags ("-0") values (now, "-0")
|
||||
sql show tags from st_double_25
|
||||
#if $data05 != 0 then
|
||||
|
@ -366,7 +366,7 @@ sql show tags from st_double_25
|
|||
sql select * from st_double_25
|
||||
#if $data01 != 0 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_26 using mt_double tags ('123') values (now, '12.3')
|
||||
sql show tags from st_double_26
|
||||
#if $data05 != 123 then
|
||||
|
@ -375,7 +375,7 @@ sql show tags from st_double_26
|
|||
sql select * from st_double_26
|
||||
#if $data01 != 123 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_27 using mt_double tags (+056) values (now, +0005.6)
|
||||
sql show tags from st_double_27
|
||||
#if $data05 != 56 then
|
||||
|
@ -384,7 +384,7 @@ sql show tags from st_double_27
|
|||
sql select * from st_double_27
|
||||
#if $data01 != 56 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_double_28 using mt_double tags (-056) values (now, -005.6)
|
||||
sql show tags from st_double_28
|
||||
#if $data05 != -56 then
|
||||
|
@ -393,7 +393,7 @@ sql show tags from st_double_28
|
|||
sql select * from st_double_28
|
||||
#if $data01 != -56 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
|
||||
### case 03: alter tag values
|
||||
#sql alter table st_double_0 set tag tagname=1.7976931348623157e+308
|
||||
|
@ -444,12 +444,12 @@ sql_error create table st_double_e0 using mt_double tags (31.7976931348623157e+3
|
|||
sql_error create table st_double_e0 using mt_double tags (-31.7976931348623157e+308)
|
||||
#sql_error create table st_double_e0 using mt_double tags (12.80) truncate integer part
|
||||
#sql_error create table st_double_e0 using mt_double tags (-11.80)
|
||||
sql_error create table st_double_e0 using mt_double tags (123abc)
|
||||
sql_error create table st_double_e0 using mt_double tags (123abc)
|
||||
sql create table st_double_e0_1 using mt_double tags ("123abc")
|
||||
sql_error create table st_double_e0 using mt_double tags (abc)
|
||||
sql create table st_double_e0_2 using mt_double tags ("abc")
|
||||
sql create table st_double_e0_3 using mt_double tags (" ")
|
||||
sql create table st_double_e0_4 using mt_double tags ('')
|
||||
sql_error create table st_double_e0 using mt_double tags (abc)
|
||||
sql create table st_double_e0_2 using mt_double tags ("abc")
|
||||
sql create table st_double_e0_3 using mt_double tags (" ")
|
||||
sql create table st_double_e0_4 using mt_double tags ('')
|
||||
|
||||
sql create table st_double_e0 using mt_double tags (123)
|
||||
sql create table st_double_e1 using mt_double tags (123)
|
||||
|
@ -465,31 +465,31 @@ sql create table st_double_e10 using mt_double tags (123)
|
|||
sql create table st_double_e11 using mt_double tags (123)
|
||||
sql create table st_double_e12 using mt_double tags (123)
|
||||
|
||||
sql_error insert into st_double_e0 values (now, 11.7976931348623157e+308)
|
||||
sql_error insert into st_double_e1 values (now, -11.7976931348623157e+308)
|
||||
sql_error insert into st_double_e2 values (now, 111.7976931348623157e+308)
|
||||
sql_error insert into st_double_e3 values (now, -111.7976931348623157e+308)
|
||||
#sql_error insert into st_double_e4 values (now, 12.80)
|
||||
#sql_error insert into st_double_e5 values (now, -11.80)
|
||||
sql_error insert into st_double_e6 values (now, 123abc)
|
||||
sql_error insert into st_double_e0 values (now, 11.7976931348623157e+308)
|
||||
sql_error insert into st_double_e1 values (now, -11.7976931348623157e+308)
|
||||
sql_error insert into st_double_e2 values (now, 111.7976931348623157e+308)
|
||||
sql_error insert into st_double_e3 values (now, -111.7976931348623157e+308)
|
||||
#sql_error insert into st_double_e4 values (now, 12.80)
|
||||
#sql_error insert into st_double_e5 values (now, -11.80)
|
||||
sql_error insert into st_double_e6 values (now, 123abc)
|
||||
sql_error insert into st_double_e7 values (now, "123abc")
|
||||
sql_error insert into st_double_e9 values (now, abc)
|
||||
sql_error insert into st_double_e10 values (now, "abc")
|
||||
sql_error insert into st_double_e11 values (now, " ")
|
||||
sql insert into st_double_e12 values (now, '')
|
||||
sql_error insert into st_double_e9 values (now, abc)
|
||||
sql_error insert into st_double_e10 values (now, "abc")
|
||||
sql_error insert into st_double_e11 values (now, " ")
|
||||
sql insert into st_double_e12 values (now, '')
|
||||
|
||||
sql_error insert into st_double_e13 using mt_double tags (033) values (now, 11.7976931348623157e+308)
|
||||
sql_error insert into st_double_e14 using mt_double tags (033) values (now, -11.7976931348623157e+308)
|
||||
sql_error insert into st_double_e15 using mt_double tags (033) values (now, 131.7976931348623157e+308)
|
||||
sql_error insert into st_double_e16 using mt_double tags (033) values (now, -131.7976931348623157e+308)
|
||||
#sql_error insert into st_double_e17 using mt_double tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_double_e18 using mt_double tags (033) values (now, -11.80)
|
||||
sql_error insert into st_double_e19 using mt_double tags (033) values (now, 123abc)
|
||||
sql_error insert into st_double_e13 using mt_double tags (033) values (now, 11.7976931348623157e+308)
|
||||
sql_error insert into st_double_e14 using mt_double tags (033) values (now, -11.7976931348623157e+308)
|
||||
sql_error insert into st_double_e15 using mt_double tags (033) values (now, 131.7976931348623157e+308)
|
||||
sql_error insert into st_double_e16 using mt_double tags (033) values (now, -131.7976931348623157e+308)
|
||||
#sql_error insert into st_double_e17 using mt_double tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_double_e18 using mt_double tags (033) values (now, -11.80)
|
||||
sql_error insert into st_double_e19 using mt_double tags (033) values (now, 123abc)
|
||||
sql_error insert into st_double_e20 using mt_double tags (033) values (now, "123abc")
|
||||
sql_error insert into st_double_e22 using mt_double tags (033) values (now, abc)
|
||||
sql_error insert into st_double_e23 using mt_double tags (033) values (now, "abc")
|
||||
sql_error insert into st_double_e24 using mt_double tags (033) values (now, " ")
|
||||
sql insert into st_double_e25_1 using mt_double tags (033) values (now, '')
|
||||
sql_error insert into st_double_e22 using mt_double tags (033) values (now, abc)
|
||||
sql_error insert into st_double_e23 using mt_double tags (033) values (now, "abc")
|
||||
sql_error insert into st_double_e24 using mt_double tags (033) values (now, " ")
|
||||
sql insert into st_double_e25_1 using mt_double tags (033) values (now, '')
|
||||
|
||||
sql_error insert into st_double_e13 using mt_double tags (31.7976931348623157e+308) values (now, -033)
|
||||
sql_error insert into st_double_e14 using mt_double tags (-31.7976931348623157e+308) values (now, -033)
|
||||
|
@ -518,15 +518,15 @@ sql insert into st_double_e23 using mt_double tags (033) values (now, 00062)
|
|||
sql insert into st_double_e24 using mt_double tags (033) values (now, 00062)
|
||||
sql insert into st_double_e25 using mt_double tags (033) values (now, 00062)
|
||||
|
||||
sql_error alter table st_double_e13 set tag tagname=1.8976931348623157e+308
|
||||
sql_error alter table st_double_e14 set tag tagname=-1.8976931348623157e+308
|
||||
sql_error alter table st_double_e15 set tag tagname=131.7976931348623157e+308
|
||||
sql_error alter table st_double_e16 set tag tagname=-131.7976931348623157e+308
|
||||
sql_error alter table st_double_e19 set tag tagname=123abc
|
||||
sql alter table st_double_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_double_e22 set tag tagname=abc
|
||||
sql alter table st_double_e23 set tag tagname="abc"
|
||||
sql alter table st_double_e24 set tag tagname=" "
|
||||
sql alter table st_double_e25 set tag tagname=''
|
||||
sql_error alter table st_double_e13 set tag tagname=1.8976931348623157e+308
|
||||
sql_error alter table st_double_e14 set tag tagname=-1.8976931348623157e+308
|
||||
sql_error alter table st_double_e15 set tag tagname=131.7976931348623157e+308
|
||||
sql_error alter table st_double_e16 set tag tagname=-131.7976931348623157e+308
|
||||
sql_error alter table st_double_e19 set tag tagname=123abc
|
||||
sql alter table st_double_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_double_e22 set tag tagname=abc
|
||||
sql alter table st_double_e23 set tag tagname="abc"
|
||||
sql alter table st_double_e24 set tag tagname=" "
|
||||
sql alter table st_double_e25 set tag tagname=''
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -12,7 +12,7 @@ sql use db
|
|||
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
|
||||
|
||||
######## case 0: float
|
||||
print ========== float
|
||||
print ========== float
|
||||
sql create table mt_float (ts timestamp, c float) tags (tagname float)
|
||||
|
||||
## case 00: static create table for test tag values
|
||||
|
@ -174,7 +174,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_float_1 values (now, NULL)
|
||||
sql select * from st_float_1
|
||||
if $rows != 1 then
|
||||
|
@ -182,7 +182,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_float_2 values (now, 'NULL')
|
||||
sql select * from st_float_2
|
||||
if $rows != 1 then
|
||||
|
@ -238,14 +238,14 @@ if $data01 != -340282346638528859811704183484516925440.00000 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql insert into st_float_8 values (now, +100.89)
|
||||
sql insert into st_float_8 values (now, +100.89)
|
||||
sql select * from st_float_8
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
#if $data01 != 100.89000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_float_9 values (now, "-0.98")
|
||||
sql select * from st_float_9
|
||||
if $rows != 1 then
|
||||
|
@ -253,7 +253,7 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != -0.980000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_float_10 values (now, '0')
|
||||
sql select * from st_float_10
|
||||
if $rows != 1 then
|
||||
|
@ -261,15 +261,15 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != 0.00000 then # tsim only print 4 bits after dot
|
||||
# return -1
|
||||
#endi
|
||||
sql insert into st_float_11 values (now, -0)
|
||||
#endi
|
||||
sql insert into st_float_11 values (now, -0)
|
||||
sql select * from st_float_11
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
#if $data01 != 0.00000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
sql insert into st_float_12 values (now, "+056")
|
||||
sql select * from st_float_12
|
||||
if $rows != 1 then
|
||||
|
@ -277,7 +277,7 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != 56.000000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
|
||||
sql insert into st_float_13 values (now, +056)
|
||||
sql select * from st_float_13
|
||||
|
@ -286,7 +286,7 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != 56.000000 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
|
||||
sql insert into st_float_14 values (now, -056)
|
||||
sql select * from st_float_14
|
||||
|
@ -295,7 +295,7 @@ if $rows != 1 then
|
|||
endi
|
||||
#if $data01 != -56 then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
|
||||
## case 02: dynamic create table for test tag values
|
||||
sql insert into st_float_16 using mt_float tags (NULL) values (now, NULL)
|
||||
|
@ -307,7 +307,7 @@ sql select * from st_float_16
|
|||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql insert into st_float_17 using mt_float tags (NULL) values (now, NULL)
|
||||
sql show tags from st_float_17
|
||||
if $data05 != NULL then
|
||||
|
@ -316,7 +316,7 @@ endi
|
|||
sql select * from st_float_17
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_float_18 using mt_float tags ('NULL') values (now, 'NULL')
|
||||
sql show tags from st_float_18
|
||||
if $data05 != NULL then
|
||||
|
@ -474,12 +474,12 @@ sql_error create table st_float_e0 using mt_float tags (333.40282347e+38)
|
|||
sql_error create table st_float_e0 using mt_float tags (-333.40282347e+38)
|
||||
#sql_error create table st_float_e0 using mt_float tags (12.80) truncate integer part
|
||||
#sql_error create table st_float_e0 using mt_float tags (-11.80)
|
||||
sql_error create table st_float_e0 using mt_float tags (123abc)
|
||||
sql_error create table st_float_e0 using mt_float tags (123abc)
|
||||
sql create table st_float_e0_1 using mt_float tags ("123abc")
|
||||
sql_error create table st_float_e0 using mt_float tags (abc)
|
||||
sql create table st_float_e0_2 using mt_float tags ("abc")
|
||||
sql create table st_float_e0_3 using mt_float tags (" ")
|
||||
sql create table st_float_e0_4 using mt_float tags ('')
|
||||
sql_error create table st_float_e0 using mt_float tags (abc)
|
||||
sql create table st_float_e0_2 using mt_float tags ("abc")
|
||||
sql create table st_float_e0_3 using mt_float tags (" ")
|
||||
sql create table st_float_e0_4 using mt_float tags ('')
|
||||
|
||||
sql create table st_float_e0 using mt_float tags (123)
|
||||
sql create table st_float_e1 using mt_float tags (123)
|
||||
|
@ -495,31 +495,31 @@ sql create table st_float_e10 using mt_float tags (123)
|
|||
sql create table st_float_e11 using mt_float tags (123)
|
||||
sql create table st_float_e12 using mt_float tags (123)
|
||||
|
||||
sql_error insert into st_float_e0 values (now, 3.50282347e+38)
|
||||
sql_error insert into st_float_e1 values (now, -3.50282347e+38)
|
||||
sql_error insert into st_float_e2 values (now, 13.40282347e+38)
|
||||
sql_error insert into st_float_e3 values (now, -13.40282347e+38)
|
||||
#sql_error insert into st_float_e4 values (now, 12.80)
|
||||
#sql_error insert into st_float_e5 values (now, -11.80)
|
||||
sql_error insert into st_float_e6 values (now, 123abc)
|
||||
sql_error insert into st_float_e0 values (now, 3.50282347e+38)
|
||||
sql_error insert into st_float_e1 values (now, -3.50282347e+38)
|
||||
sql_error insert into st_float_e2 values (now, 13.40282347e+38)
|
||||
sql_error insert into st_float_e3 values (now, -13.40282347e+38)
|
||||
#sql_error insert into st_float_e4 values (now, 12.80)
|
||||
#sql_error insert into st_float_e5 values (now, -11.80)
|
||||
sql_error insert into st_float_e6 values (now, 123abc)
|
||||
sql_error insert into st_float_e7 values (now, "123abc")
|
||||
sql_error insert into st_float_e9 values (now, abc)
|
||||
sql_error insert into st_float_e10 values (now, "abc")
|
||||
sql_error insert into st_float_e11 values (now, " ")
|
||||
sql insert into st_float_e12 values (now, '')
|
||||
sql_error insert into st_float_e9 values (now, abc)
|
||||
sql_error insert into st_float_e10 values (now, "abc")
|
||||
sql_error insert into st_float_e11 values (now, " ")
|
||||
sql insert into st_float_e12 values (now, '')
|
||||
|
||||
sql_error insert into st_float_e13 using mt_float tags (033) values (now, 3.50282347e+38)
|
||||
sql_error insert into st_float_e14 using mt_float tags (033) values (now, -3.50282347e+38)
|
||||
sql_error insert into st_float_e15 using mt_float tags (033) values (now, 13.40282347e+38)
|
||||
sql_error insert into st_float_e16 using mt_float tags (033) values (now, -13.40282347e+38)
|
||||
#sql_error insert into st_float_e17 using mt_float tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_float_e18 using mt_float tags (033) values (now, -11.80)
|
||||
sql_error insert into st_float_e19 using mt_float tags (033) values (now, 123abc)
|
||||
sql_error insert into st_float_e13 using mt_float tags (033) values (now, 3.50282347e+38)
|
||||
sql_error insert into st_float_e14 using mt_float tags (033) values (now, -3.50282347e+38)
|
||||
sql_error insert into st_float_e15 using mt_float tags (033) values (now, 13.40282347e+38)
|
||||
sql_error insert into st_float_e16 using mt_float tags (033) values (now, -13.40282347e+38)
|
||||
#sql_error insert into st_float_e17 using mt_float tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_float_e18 using mt_float tags (033) values (now, -11.80)
|
||||
sql_error insert into st_float_e19 using mt_float tags (033) values (now, 123abc)
|
||||
sql_error insert into st_float_e20 using mt_float tags (033) values (now, "123abc")
|
||||
sql_error insert into st_float_e22 using mt_float tags (033) values (now, abc)
|
||||
sql_error insert into st_float_e23 using mt_float tags (033) values (now, "abc")
|
||||
sql_error insert into st_float_e24 using mt_float tags (033) values (now, " ")
|
||||
sql insert into st_float_e25_1 using mt_float tags (033) values (now, '')
|
||||
sql_error insert into st_float_e22 using mt_float tags (033) values (now, abc)
|
||||
sql_error insert into st_float_e23 using mt_float tags (033) values (now, "abc")
|
||||
sql_error insert into st_float_e24 using mt_float tags (033) values (now, " ")
|
||||
sql insert into st_float_e25_1 using mt_float tags (033) values (now, '')
|
||||
|
||||
sql_error insert into st_float_e13 using mt_float tags (3.50282347e+38) values (now, -033)
|
||||
sql_error insert into st_float_e14 using mt_float tags (-3.50282347e+38) values (now, -033)
|
||||
|
@ -548,15 +548,15 @@ sql insert into st_float_e23 using mt_float tags (033) values (now, 00062)
|
|||
sql insert into st_float_e24 using mt_float tags (033) values (now, 00062)
|
||||
sql insert into st_float_e25 using mt_float tags (033) values (now, 00062)
|
||||
|
||||
sql_error alter table st_float_e13 set tag tagname=3.50282347e+38
|
||||
sql_error alter table st_float_e14 set tag tagname=-3.50282347e+38
|
||||
sql_error alter table st_float_e15 set tag tagname=13.40282347e+38
|
||||
sql_error alter table st_float_e16 set tag tagname=-13.40282347e+38
|
||||
sql_error alter table st_float_e19 set tag tagname=123abc
|
||||
sql alter table st_float_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_float_e22 set tag tagname=abc
|
||||
sql alter table st_float_e23 set tag tagname="abc"
|
||||
sql alter table st_float_e24 set tag tagname=" "
|
||||
sql alter table st_float_e25 set tag tagname=''
|
||||
sql_error alter table st_float_e13 set tag tagname=3.50282347e+38
|
||||
sql_error alter table st_float_e14 set tag tagname=-3.50282347e+38
|
||||
sql_error alter table st_float_e15 set tag tagname=13.40282347e+38
|
||||
sql_error alter table st_float_e16 set tag tagname=-13.40282347e+38
|
||||
sql_error alter table st_float_e19 set tag tagname=123abc
|
||||
sql alter table st_float_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_float_e22 set tag tagname=abc
|
||||
sql alter table st_float_e23 set tag tagname="abc"
|
||||
sql alter table st_float_e24 set tag tagname=" "
|
||||
sql alter table st_float_e25 set tag tagname=''
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -12,7 +12,7 @@ sql use db
|
|||
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
|
||||
|
||||
######## case 0: int
|
||||
print ========== int
|
||||
print ========== int
|
||||
sql create table mt_int (ts timestamp, c int) tags (tagname int)
|
||||
|
||||
## case 00: static create table for test tag values
|
||||
|
@ -86,7 +86,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_1 values (now, NULL)
|
||||
sql select * from st_int_1
|
||||
if $rows != 1 then
|
||||
|
@ -94,7 +94,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_6 values (now, 2147483647)
|
||||
sql select * from st_int_6
|
||||
if $rows != 1 then
|
||||
|
@ -102,7 +102,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 2147483647 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_7 values (now, -2147483647)
|
||||
sql select * from st_int_7
|
||||
if $rows != 1 then
|
||||
|
@ -110,15 +110,15 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -2147483647 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_int_8 values (now, +100)
|
||||
endi
|
||||
sql insert into st_int_8 values (now, +100)
|
||||
sql select * from st_int_8
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 100 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_9 values (now, "-098")
|
||||
sql select * from st_int_9
|
||||
if $rows != 1 then
|
||||
|
@ -126,7 +126,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -98 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_10 values (now, '0')
|
||||
sql select * from st_int_10
|
||||
if $rows != 1 then
|
||||
|
@ -134,15 +134,15 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_int_11 values (now, -0)
|
||||
endi
|
||||
sql insert into st_int_11 values (now, -0)
|
||||
sql select * from st_int_11
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_12 values (now, "+056")
|
||||
sql select * from st_int_12
|
||||
if $rows != 1 then
|
||||
|
@ -150,7 +150,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql insert into st_int_13 values (now, +056)
|
||||
sql select * from st_int_13
|
||||
|
@ -159,7 +159,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql insert into st_int_14 values (now, -056)
|
||||
sql select * from st_int_14
|
||||
|
@ -168,7 +168,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
## case 02: dynamic create table for test tag values
|
||||
sql insert into st_int_16 using mt_int tags (NULL) values (now, NULL)
|
||||
|
@ -180,7 +180,7 @@ sql select * from st_int_16
|
|||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql insert into st_int_17 using mt_int tags (NULL) values (now, NULL)
|
||||
sql show tags from st_int_17
|
||||
if $data05 != NULL then
|
||||
|
@ -189,7 +189,7 @@ endi
|
|||
sql select * from st_int_17
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_18 using mt_int tags ('NULL') values (now, 'NULL')
|
||||
sql show tags from st_int_18
|
||||
if $data05 != NULL then
|
||||
|
@ -234,7 +234,7 @@ endi
|
|||
sql select * from st_int_22
|
||||
if $data01 != 2147483647 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_23 using mt_int tags (-2147483647) values (now, -2147483647)
|
||||
sql show tags from st_int_23
|
||||
if $data05 != -2147483647 then
|
||||
|
@ -243,7 +243,7 @@ endi
|
|||
sql select * from st_int_23
|
||||
if $data01 != -2147483647 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_24 using mt_int tags (10) values (now, 10)
|
||||
sql show tags from st_int_24
|
||||
if $data05 != 10 then
|
||||
|
@ -252,7 +252,7 @@ endi
|
|||
sql select * from st_int_24
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_25 using mt_int tags ("-0") values (now, "-0")
|
||||
sql show tags from st_int_25
|
||||
if $data05 != 0 then
|
||||
|
@ -261,7 +261,7 @@ endi
|
|||
sql select * from st_int_25
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_26 using mt_int tags ('123') values (now, '123')
|
||||
sql show tags from st_int_26
|
||||
if $data05 != 123 then
|
||||
|
@ -270,7 +270,7 @@ endi
|
|||
sql select * from st_int_26
|
||||
if $data01 != 123 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_27 using mt_int tags (+056) values (now, +00056)
|
||||
sql show tags from st_int_27
|
||||
if $data05 != 56 then
|
||||
|
@ -279,7 +279,7 @@ endi
|
|||
sql select * from st_int_27
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_int_28 using mt_int tags (-056) values (now, -0056)
|
||||
sql show tags from st_int_28
|
||||
if $data05 != -56 then
|
||||
|
@ -288,7 +288,7 @@ endi
|
|||
sql select * from st_int_28
|
||||
if $data01 != -56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
### case 03: alter tag values
|
||||
#sql alter table st_int_0 set tag tagname=2147483647
|
||||
|
@ -339,12 +339,12 @@ sql_error create table st_int_e0 using mt_int tags (214748364800)
|
|||
sql_error create table st_int_e0 using mt_int tags (-214748364800)
|
||||
#sql_error create table st_int_e0 using mt_int tags (12.80) truncate integer part
|
||||
#sql_error create table st_int_e0 using mt_int tags (-11.80)
|
||||
sql_error create table st_int_e0 using mt_int tags (123abc)
|
||||
sql_error create table st_int_e0 using mt_int tags (123abc)
|
||||
sql_error create table st_int_e0 using mt_int tags ("123abc")
|
||||
sql_error create table st_int_e0 using mt_int tags (abc)
|
||||
sql_error create table st_int_e0 using mt_int tags ("abc")
|
||||
sql_error create table st_int_e0 using mt_int tags (" ")
|
||||
sql create table st_int_e0_err2 using mt_int tags ('')
|
||||
sql_error create table st_int_e0 using mt_int tags (abc)
|
||||
sql_error create table st_int_e0 using mt_int tags ("abc")
|
||||
sql_error create table st_int_e0 using mt_int tags (" ")
|
||||
sql create table st_int_e0_err2 using mt_int tags ('')
|
||||
|
||||
sql create table st_int_e0 using mt_int tags (123)
|
||||
sql create table st_int_e1 using mt_int tags (123)
|
||||
|
@ -360,31 +360,31 @@ sql create table st_int_e10 using mt_int tags (123)
|
|||
sql create table st_int_e11 using mt_int tags (123)
|
||||
sql create table st_int_e12 using mt_int tags (123)
|
||||
|
||||
sql_error insert into st_int_e0 values (now, 2147483648)
|
||||
sql insert into st_int_e1 values (now, -2147483648)
|
||||
sql_error insert into st_int_e2 values (now, 3147483648)
|
||||
sql_error insert into st_int_e3 values (now, -21474836481)
|
||||
#sql_error insert into st_int_e4 values (now, 12.80)
|
||||
#sql_error insert into st_int_e5 values (now, -11.80)
|
||||
sql_error insert into st_int_e6 values (now, 123abc)
|
||||
sql_error insert into st_int_e0 values (now, 2147483648)
|
||||
sql insert into st_int_e1 values (now, -2147483648)
|
||||
sql_error insert into st_int_e2 values (now, 3147483648)
|
||||
sql_error insert into st_int_e3 values (now, -21474836481)
|
||||
#sql_error insert into st_int_e4 values (now, 12.80)
|
||||
#sql_error insert into st_int_e5 values (now, -11.80)
|
||||
sql_error insert into st_int_e6 values (now, 123abc)
|
||||
sql_error insert into st_int_e7 values (now, "123abc")
|
||||
sql_error insert into st_int_e9 values (now, abc)
|
||||
sql_error insert into st_int_e10 values (now, "abc")
|
||||
sql_error insert into st_int_e11 values (now, " ")
|
||||
sql insert into st_int_e12 values (now, '')
|
||||
sql_error insert into st_int_e9 values (now, abc)
|
||||
sql_error insert into st_int_e10 values (now, "abc")
|
||||
sql_error insert into st_int_e11 values (now, " ")
|
||||
sql insert into st_int_e12 values (now, '')
|
||||
|
||||
sql_error insert into st_int_e13 using mt_int tags (033) values (now, 2147483648)
|
||||
sql insert into st_int_e14 using mt_int tags (033) values (now, -2147483648)
|
||||
sql_error insert into st_int_e15 using mt_int tags (033) values (now, 5147483648)
|
||||
sql_error insert into st_int_e16 using mt_int tags (033) values (now, -21474836481)
|
||||
#sql_error insert into st_int_e17 using mt_int tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_int_e18 using mt_int tags (033) values (now, -11.80)
|
||||
sql_error insert into st_int_e19 using mt_int tags (033) values (now, 123abc)
|
||||
sql_error insert into st_int_e13 using mt_int tags (033) values (now, 2147483648)
|
||||
sql insert into st_int_e14 using mt_int tags (033) values (now, -2147483648)
|
||||
sql_error insert into st_int_e15 using mt_int tags (033) values (now, 5147483648)
|
||||
sql_error insert into st_int_e16 using mt_int tags (033) values (now, -21474836481)
|
||||
#sql_error insert into st_int_e17 using mt_int tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_int_e18 using mt_int tags (033) values (now, -11.80)
|
||||
sql_error insert into st_int_e19 using mt_int tags (033) values (now, 123abc)
|
||||
sql_error insert into st_int_e20 using mt_int tags (033) values (now, "123abc")
|
||||
sql_error insert into st_int_e22 using mt_int tags (033) values (now, abc)
|
||||
sql_error insert into st_int_e23 using mt_int tags (033) values (now, "abc")
|
||||
sql_error insert into st_int_e24 using mt_int tags (033) values (now, " ")
|
||||
sql insert into st_int_e25 using mt_int tags (033) values (now, '')
|
||||
sql_error insert into st_int_e22 using mt_int tags (033) values (now, abc)
|
||||
sql_error insert into st_int_e23 using mt_int tags (033) values (now, "abc")
|
||||
sql_error insert into st_int_e24 using mt_int tags (033) values (now, " ")
|
||||
sql insert into st_int_e25 using mt_int tags (033) values (now, '')
|
||||
|
||||
sql_error insert into st_int_e13 using mt_int tags (2147483648) values (now, -033)
|
||||
sql insert into st_int_e14_1 using mt_int tags (-2147483648) values (now, -033)
|
||||
|
@ -413,15 +413,15 @@ sql insert into st_int_e23 using mt_int tags (033) values (now, 00062)
|
|||
sql insert into st_int_e24 using mt_int tags (033) values (now, 00062)
|
||||
sql insert into st_int_e25 using mt_int tags (033) values (now, 00062)
|
||||
|
||||
sql_error alter table st_int_e13 set tag tagname=2147483648
|
||||
sql alter table st_int_e14 set tag tagname=-2147483648
|
||||
sql_error alter table st_int_e15 set tag tagname=12147483648
|
||||
sql_error alter table st_int_e13 set tag tagname=2147483648
|
||||
sql alter table st_int_e14 set tag tagname=-2147483648
|
||||
sql_error alter table st_int_e15 set tag tagname=12147483648
|
||||
sql_error alter table st_int_e16 set tag tagname=-3147483648
|
||||
sql_error alter table st_int_e19 set tag tagname=123abc
|
||||
sql_error alter table st_int_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_int_e22 set tag tagname=abc
|
||||
sql_error alter table st_int_e23 set tag tagname="abc"
|
||||
sql_error alter table st_int_e24 set tag tagname=" "
|
||||
sql alter table st_int_e25 set tag tagname=''
|
||||
sql_error alter table st_int_e19 set tag tagname=123abc
|
||||
sql_error alter table st_int_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_int_e22 set tag tagname=abc
|
||||
sql_error alter table st_int_e23 set tag tagname="abc"
|
||||
sql_error alter table st_int_e24 set tag tagname=" "
|
||||
sql alter table st_int_e25 set tag tagname=''
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -15,7 +15,7 @@ sql create database db
|
|||
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
|
||||
|
||||
######## case 0: smallint
|
||||
print ========== smallint
|
||||
print ========== smallint
|
||||
sql create table mt_smallint (ts timestamp, c smallint) tags (tagname smallint)
|
||||
|
||||
## case 00: static create table for test tag values
|
||||
|
@ -89,7 +89,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_1 values (now, NULL)
|
||||
sql select * from st_smallint_1
|
||||
if $rows != 1 then
|
||||
|
@ -97,7 +97,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_6 values (now, 32767)
|
||||
sql select * from st_smallint_6
|
||||
if $rows != 1 then
|
||||
|
@ -105,7 +105,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 32767 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_7 values (now, -32767)
|
||||
sql select * from st_smallint_7
|
||||
if $rows != 1 then
|
||||
|
@ -113,15 +113,15 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -32767 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_smallint_8 values (now, +100)
|
||||
endi
|
||||
sql insert into st_smallint_8 values (now, +100)
|
||||
sql select * from st_smallint_8
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 100 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_9 values (now, "-098")
|
||||
sql select * from st_smallint_9
|
||||
if $rows != 1 then
|
||||
|
@ -129,7 +129,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -98 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_10 values (now, '0')
|
||||
sql select * from st_smallint_10
|
||||
if $rows != 1 then
|
||||
|
@ -137,15 +137,15 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_smallint_11 values (now, -0)
|
||||
endi
|
||||
sql insert into st_smallint_11 values (now, -0)
|
||||
sql select * from st_smallint_11
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_12 values (now, "+056")
|
||||
sql select * from st_smallint_12
|
||||
if $rows != 1 then
|
||||
|
@ -153,7 +153,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql insert into st_smallint_13 values (now, +056)
|
||||
sql select * from st_smallint_13
|
||||
|
@ -162,7 +162,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql insert into st_smallint_14 values (now, -056)
|
||||
sql select * from st_smallint_14
|
||||
|
@ -171,7 +171,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
## case 02: dynamic create table for test tag values
|
||||
sql insert into st_smallint_16 using mt_smallint tags (NULL) values (now, NULL)
|
||||
|
@ -183,7 +183,7 @@ sql select * from st_smallint_16
|
|||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql insert into st_smallint_17 using mt_smallint tags (NULL) values (now, NULL)
|
||||
sql show tags from st_smallint_17
|
||||
if $data05 != NULL then
|
||||
|
@ -192,7 +192,7 @@ endi
|
|||
sql select * from st_smallint_17
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_18 using mt_smallint tags ('NULL') values (now, 'NULL')
|
||||
sql show tags from st_smallint_18
|
||||
if $data05 != NULL then
|
||||
|
@ -237,7 +237,7 @@ endi
|
|||
sql select * from st_smallint_22
|
||||
if $data01 != 32767 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_23 using mt_smallint tags (-32767) values (now, -32767)
|
||||
sql show tags from st_smallint_23
|
||||
if $data05 != -32767 then
|
||||
|
@ -246,7 +246,7 @@ endi
|
|||
sql select * from st_smallint_23
|
||||
if $data01 != -32767 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_24 using mt_smallint tags (10) values (now, 10)
|
||||
sql show tags from st_smallint_24
|
||||
if $data05 != 10 then
|
||||
|
@ -255,7 +255,7 @@ endi
|
|||
sql select * from st_smallint_24
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_25 using mt_smallint tags ("-0") values (now, "-0")
|
||||
sql show tags from st_smallint_25
|
||||
if $data05 != 0 then
|
||||
|
@ -264,7 +264,7 @@ endi
|
|||
sql select * from st_smallint_25
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_26 using mt_smallint tags ('123') values (now, '123')
|
||||
sql show tags from st_smallint_26
|
||||
if $data05 != 123 then
|
||||
|
@ -273,7 +273,7 @@ endi
|
|||
sql select * from st_smallint_26
|
||||
if $data01 != 123 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_27 using mt_smallint tags (+056) values (now, +00056)
|
||||
sql show tags from st_smallint_27
|
||||
if $data05 != 56 then
|
||||
|
@ -282,7 +282,7 @@ endi
|
|||
sql select * from st_smallint_27
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_smallint_28 using mt_smallint tags (-056) values (now, -0056)
|
||||
sql show tags from st_smallint_28
|
||||
if $data05 != -56 then
|
||||
|
@ -291,7 +291,7 @@ endi
|
|||
sql select * from st_smallint_28
|
||||
if $data01 != -56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
## case 03: alter tag values
|
||||
#sql alter table st_smallint_0 set tag tagname=32767
|
||||
|
@ -342,12 +342,12 @@ sql_error create table st_smallint_e0 using mt_smallint tags (3276899)
|
|||
sql_error create table st_smallint_e0 using mt_smallint tags (-3276833)
|
||||
#sql_error create table st_smallint_e0 using mt_smallint tags (12.80) truncate integer part
|
||||
#sql_error create table st_smallint_e0 using mt_smallint tags (-11.80)
|
||||
sql_error create table st_smallint_e0 using mt_smallint tags (123abc)
|
||||
sql_error create table st_smallint_e0 using mt_smallint tags (123abc)
|
||||
sql_error create table st_smallint_e0 using mt_smallint tags ("123abc")
|
||||
sql_error create table st_smallint_e0 using mt_smallint tags (abc)
|
||||
sql_error create table st_smallint_e0 using mt_smallint tags ("abc")
|
||||
sql_error create table st_smallint_e0 using mt_smallint tags (" ")
|
||||
sql create table st_smallint_e0_1 using mt_smallint tags ('')
|
||||
sql_error create table st_smallint_e0 using mt_smallint tags (abc)
|
||||
sql_error create table st_smallint_e0 using mt_smallint tags ("abc")
|
||||
sql_error create table st_smallint_e0 using mt_smallint tags (" ")
|
||||
sql create table st_smallint_e0_1 using mt_smallint tags ('')
|
||||
|
||||
sql create table st_smallint_e0 using mt_smallint tags (123)
|
||||
sql create table st_smallint_e1 using mt_smallint tags (123)
|
||||
|
@ -363,31 +363,31 @@ sql create table st_smallint_e10 using mt_smallint tags (123)
|
|||
sql create table st_smallint_e11 using mt_smallint tags (123)
|
||||
sql create table st_smallint_e12 using mt_smallint tags (123)
|
||||
|
||||
sql_error insert into st_smallint_e0 values (now, 32768)
|
||||
sql insert into st_smallint_e1 values (now, -32768)
|
||||
sql_error insert into st_smallint_e2 values (now, 42768)
|
||||
sql_error insert into st_smallint_e3 values (now, -32769)
|
||||
#sql_error insert into st_smallint_e4 values (now, 12.80)
|
||||
#sql_error insert into st_smallint_e5 values (now, -11.80)
|
||||
sql_error insert into st_smallint_e6 values (now, 123abc)
|
||||
sql_error insert into st_smallint_e0 values (now, 32768)
|
||||
sql insert into st_smallint_e1 values (now, -32768)
|
||||
sql_error insert into st_smallint_e2 values (now, 42768)
|
||||
sql_error insert into st_smallint_e3 values (now, -32769)
|
||||
#sql_error insert into st_smallint_e4 values (now, 12.80)
|
||||
#sql_error insert into st_smallint_e5 values (now, -11.80)
|
||||
sql_error insert into st_smallint_e6 values (now, 123abc)
|
||||
sql_error insert into st_smallint_e7 values (now, "123abc")
|
||||
sql_error insert into st_smallint_e9 values (now, abc)
|
||||
sql_error insert into st_smallint_e10 values (now, "abc")
|
||||
sql_error insert into st_smallint_e11 values (now, " ")
|
||||
sql insert into st_smallint_e12 values (now, '')
|
||||
sql_error insert into st_smallint_e9 values (now, abc)
|
||||
sql_error insert into st_smallint_e10 values (now, "abc")
|
||||
sql_error insert into st_smallint_e11 values (now, " ")
|
||||
sql insert into st_smallint_e12 values (now, '')
|
||||
|
||||
sql_error insert into st_smallint_e13 using mt_smallint tags (033) values (now, 32768)
|
||||
sql insert into st_smallint_e14_1 using mt_smallint tags (033) values (now, -32768)
|
||||
sql_error insert into st_smallint_e15 using mt_smallint tags (033) values (now, 32968)
|
||||
sql_error insert into st_smallint_e16 using mt_smallint tags (033) values (now, -33768)
|
||||
#sql_error insert into st_smallint_e17 using mt_smallint tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_smallint_e18 using mt_smallint tags (033) values (now, -11.80)
|
||||
sql_error insert into st_smallint_e19 using mt_smallint tags (033) values (now, 123abc)
|
||||
sql_error insert into st_smallint_e13 using mt_smallint tags (033) values (now, 32768)
|
||||
sql insert into st_smallint_e14_1 using mt_smallint tags (033) values (now, -32768)
|
||||
sql_error insert into st_smallint_e15 using mt_smallint tags (033) values (now, 32968)
|
||||
sql_error insert into st_smallint_e16 using mt_smallint tags (033) values (now, -33768)
|
||||
#sql_error insert into st_smallint_e17 using mt_smallint tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_smallint_e18 using mt_smallint tags (033) values (now, -11.80)
|
||||
sql_error insert into st_smallint_e19 using mt_smallint tags (033) values (now, 123abc)
|
||||
sql_error insert into st_smallint_e20 using mt_smallint tags (033) values (now, "123abc")
|
||||
sql_error insert into st_smallint_e22 using mt_smallint tags (033) values (now, abc)
|
||||
sql_error insert into st_smallint_e23 using mt_smallint tags (033) values (now, "abc")
|
||||
sql_error insert into st_smallint_e24 using mt_smallint tags (033) values (now, " ")
|
||||
sql insert into st_smallint_e25_1 using mt_smallint tags (033) values (now, '')
|
||||
sql_error insert into st_smallint_e22 using mt_smallint tags (033) values (now, abc)
|
||||
sql_error insert into st_smallint_e23 using mt_smallint tags (033) values (now, "abc")
|
||||
sql_error insert into st_smallint_e24 using mt_smallint tags (033) values (now, " ")
|
||||
sql insert into st_smallint_e25_1 using mt_smallint tags (033) values (now, '')
|
||||
|
||||
sql_error insert into st_smallint_e13 using mt_smallint tags (32768) values (now, -033)
|
||||
sql insert into st_smallint_e14 using mt_smallint tags (-32768) values (now, -033)
|
||||
|
@ -416,15 +416,15 @@ sql insert into st_smallint_e23 using mt_smallint tags (033) values (now, 00062)
|
|||
sql insert into st_smallint_e24 using mt_smallint tags (033) values (now, 00062)
|
||||
sql insert into st_smallint_e25 using mt_smallint tags (033) values (now, 00062)
|
||||
|
||||
sql_error alter table st_smallint_e13 set tag tagname=32768
|
||||
sql alter table st_smallint_e14 set tag tagname=-32768
|
||||
sql_error alter table st_smallint_e15 set tag tagname=52768
|
||||
sql_error alter table st_smallint_e16 set tag tagname=-32778
|
||||
sql_error alter table st_smallint_e19 set tag tagname=123abc
|
||||
sql_error alter table st_smallint_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_smallint_e22 set tag tagname=abc
|
||||
sql_error alter table st_smallint_e23 set tag tagname="abc"
|
||||
sql_error alter table st_smallint_e24 set tag tagname=" "
|
||||
sql alter table st_smallint_e25 set tag tagname=''
|
||||
sql_error alter table st_smallint_e13 set tag tagname=32768
|
||||
sql alter table st_smallint_e14 set tag tagname=-32768
|
||||
sql_error alter table st_smallint_e15 set tag tagname=52768
|
||||
sql_error alter table st_smallint_e16 set tag tagname=-32778
|
||||
sql_error alter table st_smallint_e19 set tag tagname=123abc
|
||||
sql_error alter table st_smallint_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_smallint_e22 set tag tagname=abc
|
||||
sql_error alter table st_smallint_e23 set tag tagname="abc"
|
||||
sql_error alter table st_smallint_e24 set tag tagname=" "
|
||||
sql alter table st_smallint_e25 set tag tagname=''
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -12,7 +12,7 @@ sql use db
|
|||
#### test the value of all data types in four cases: static create table, insert column value, synamic create table, alter tag value
|
||||
|
||||
######## case 0: tinyint
|
||||
print ========== tinyint
|
||||
print ========== tinyint
|
||||
sql create table mt_tinyint (ts timestamp, c tinyint) tags (tagname tinyint)
|
||||
|
||||
## case 00: static create table for test tag values
|
||||
|
@ -87,7 +87,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_1 values (now, NULL)
|
||||
sql select * from st_tinyint_1
|
||||
if $rows != 1 then
|
||||
|
@ -95,7 +95,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_6 values (now, 127)
|
||||
sql select * from st_tinyint_6
|
||||
if $rows != 1 then
|
||||
|
@ -103,7 +103,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 127 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_7 values (now, -127)
|
||||
sql select * from st_tinyint_7
|
||||
if $rows != 1 then
|
||||
|
@ -111,15 +111,15 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -127 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_tinyint_8 values (now, +100)
|
||||
endi
|
||||
sql insert into st_tinyint_8 values (now, +100)
|
||||
sql select * from st_tinyint_8
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 100 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_9 values (now, "-098")
|
||||
sql select * from st_tinyint_9
|
||||
if $rows != 1 then
|
||||
|
@ -127,7 +127,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -98 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_10 values (now, '0')
|
||||
sql select * from st_tinyint_10
|
||||
if $rows != 1 then
|
||||
|
@ -135,15 +135,15 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql insert into st_tinyint_11 values (now, -0)
|
||||
endi
|
||||
sql insert into st_tinyint_11 values (now, -0)
|
||||
sql select * from st_tinyint_11
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_12 values (now, "+056")
|
||||
sql select * from st_tinyint_12
|
||||
if $rows != 1 then
|
||||
|
@ -151,7 +151,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql insert into st_tinyint_13 values (now, +056)
|
||||
sql select * from st_tinyint_13
|
||||
|
@ -160,7 +160,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql insert into st_tinyint_14 values (now, -056)
|
||||
sql select * from st_tinyint_14
|
||||
|
@ -169,7 +169,7 @@ if $rows != 1 then
|
|||
endi
|
||||
if $data01 != -56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
## case 02: dynamic create table for test tag values
|
||||
sql insert into st_tinyint_16 using mt_tinyint tags (NULL) values (now, NULL)
|
||||
|
@ -181,7 +181,7 @@ sql select * from st_tinyint_16
|
|||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql insert into st_tinyint_17 using mt_tinyint tags (NULL) values (now, NULL)
|
||||
sql show tags from st_tinyint_17
|
||||
if $data05 != NULL then
|
||||
|
@ -190,7 +190,7 @@ endi
|
|||
sql select * from st_tinyint_17
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_18 using mt_tinyint tags ('NULL') values (now, 'NULL')
|
||||
sql show tags from st_tinyint_18
|
||||
if $data05 != NULL then
|
||||
|
@ -235,7 +235,7 @@ endi
|
|||
sql select * from st_tinyint_22
|
||||
if $data01 != 127 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_23 using mt_tinyint tags (-127) values (now, -127)
|
||||
sql show tags from st_tinyint_23
|
||||
if $data05 != -127 then
|
||||
|
@ -244,7 +244,7 @@ endi
|
|||
sql select * from st_tinyint_23
|
||||
if $data01 != -127 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_24 using mt_tinyint tags (10) values (now, 10)
|
||||
sql show tags from st_tinyint_24
|
||||
if $data05 != 10 then
|
||||
|
@ -253,7 +253,7 @@ endi
|
|||
sql select * from st_tinyint_24
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_25 using mt_tinyint tags ("-0") values (now, "-0")
|
||||
sql show tags from st_tinyint_25
|
||||
if $data05 != 0 then
|
||||
|
@ -262,7 +262,7 @@ endi
|
|||
sql select * from st_tinyint_25
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_26 using mt_tinyint tags ('123') values (now, '123')
|
||||
sql show tags from st_tinyint_26
|
||||
if $data05 != 123 then
|
||||
|
@ -271,7 +271,7 @@ endi
|
|||
sql select * from st_tinyint_26
|
||||
if $data01 != 123 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_27 using mt_tinyint tags (+056) values (now, +00056)
|
||||
sql show tags from st_tinyint_27
|
||||
if $data05 != 56 then
|
||||
|
@ -280,7 +280,7 @@ endi
|
|||
sql select * from st_tinyint_27
|
||||
if $data01 != 56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
sql insert into st_tinyint_28 using mt_tinyint tags (-056) values (now, -0056)
|
||||
sql show tags from st_tinyint_28
|
||||
if $data05 != -56 then
|
||||
|
@ -289,7 +289,7 @@ endi
|
|||
sql select * from st_tinyint_28
|
||||
if $data01 != -56 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
## case 03: alter tag values
|
||||
#sql alter table st_tinyint_0 set tag tagname=127
|
||||
|
@ -340,12 +340,12 @@ sql_error create table st_tinyint_e0 using mt_tinyint tags (1280)
|
|||
sql_error create table st_tinyint_e0 using mt_tinyint tags (-1280)
|
||||
#sql_error create table st_tinyint_e0 using mt_tinyint tags (12.80) truncate integer part
|
||||
#sql_error create table st_tinyint_e0 using mt_tinyint tags (-11.80)
|
||||
sql_error create table st_tinyint_e0 using mt_tinyint tags (123abc)
|
||||
sql_error create table st_tinyint_e0 using mt_tinyint tags (123abc)
|
||||
sql_error create table st_tinyint_e0 using mt_tinyint tags ("123abc")
|
||||
sql_error create table st_tinyint_e0 using mt_tinyint tags (abc)
|
||||
sql_error create table st_tinyint_e0 using mt_tinyint tags ("abc")
|
||||
sql_error create table st_tinyint_e0 using mt_tinyint tags (" ")
|
||||
sql create table st_tinyint_e0_2 using mt_tinyint tags ('')
|
||||
sql_error create table st_tinyint_e0 using mt_tinyint tags (abc)
|
||||
sql_error create table st_tinyint_e0 using mt_tinyint tags ("abc")
|
||||
sql_error create table st_tinyint_e0 using mt_tinyint tags (" ")
|
||||
sql create table st_tinyint_e0_2 using mt_tinyint tags ('')
|
||||
|
||||
sql create table st_tinyint_e0 using mt_tinyint tags (123)
|
||||
sql create table st_tinyint_e1 using mt_tinyint tags (123)
|
||||
|
@ -361,31 +361,31 @@ sql create table st_tinyint_e10 using mt_tinyint tags (123)
|
|||
sql create table st_tinyint_e11 using mt_tinyint tags (123)
|
||||
sql create table st_tinyint_e12 using mt_tinyint tags (123)
|
||||
|
||||
sql_error insert into st_tinyint_e0 values (now, 128)
|
||||
sql insert into st_tinyint_e1 values (now, -128)
|
||||
sql_error insert into st_tinyint_e2 values (now, 1280)
|
||||
sql_error insert into st_tinyint_e3 values (now, -1280)
|
||||
#sql_error insert into st_tinyint_e4 values (now, 12.80)
|
||||
#sql_error insert into st_tinyint_e5 values (now, -11.80)
|
||||
sql_error insert into st_tinyint_e6 values (now, 123abc)
|
||||
sql_error insert into st_tinyint_e0 values (now, 128)
|
||||
sql insert into st_tinyint_e1 values (now, -128)
|
||||
sql_error insert into st_tinyint_e2 values (now, 1280)
|
||||
sql_error insert into st_tinyint_e3 values (now, -1280)
|
||||
#sql_error insert into st_tinyint_e4 values (now, 12.80)
|
||||
#sql_error insert into st_tinyint_e5 values (now, -11.80)
|
||||
sql_error insert into st_tinyint_e6 values (now, 123abc)
|
||||
sql_error insert into st_tinyint_e7 values (now, "123abc")
|
||||
sql_error insert into st_tinyint_e9 values (now, abc)
|
||||
sql_error insert into st_tinyint_e10 values (now, "abc")
|
||||
sql_error insert into st_tinyint_e11 values (now, " ")
|
||||
sql insert into st_tinyint_e12 values (now, '')
|
||||
sql_error insert into st_tinyint_e9 values (now, abc)
|
||||
sql_error insert into st_tinyint_e10 values (now, "abc")
|
||||
sql_error insert into st_tinyint_e11 values (now, " ")
|
||||
sql insert into st_tinyint_e12 values (now, '')
|
||||
|
||||
sql_error insert into st_tinyint_e13 using mt_tinyint tags (033) values (now, 128)
|
||||
sql insert into st_tinyint_e14_1 using mt_tinyint tags (033) values (now, -128)
|
||||
sql_error insert into st_tinyint_e15 using mt_tinyint tags (033) values (now, 1280)
|
||||
sql_error insert into st_tinyint_e16 using mt_tinyint tags (033) values (now, -1280)
|
||||
#sql_error insert into st_tinyint_e17 using mt_tinyint tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_tinyint_e18 using mt_tinyint tags (033) values (now, -11.80)
|
||||
sql_error insert into st_tinyint_e19 using mt_tinyint tags (033) values (now, 123abc)
|
||||
sql_error insert into st_tinyint_e13 using mt_tinyint tags (033) values (now, 128)
|
||||
sql insert into st_tinyint_e14_1 using mt_tinyint tags (033) values (now, -128)
|
||||
sql_error insert into st_tinyint_e15 using mt_tinyint tags (033) values (now, 1280)
|
||||
sql_error insert into st_tinyint_e16 using mt_tinyint tags (033) values (now, -1280)
|
||||
#sql_error insert into st_tinyint_e17 using mt_tinyint tags (033) values (now, 12.80)
|
||||
#sql_error insert into st_tinyint_e18 using mt_tinyint tags (033) values (now, -11.80)
|
||||
sql_error insert into st_tinyint_e19 using mt_tinyint tags (033) values (now, 123abc)
|
||||
sql_error insert into st_tinyint_e20 using mt_tinyint tags (033) values (now, "123abc")
|
||||
sql_error insert into st_tinyint_e22 using mt_tinyint tags (033) values (now, abc)
|
||||
sql_error insert into st_tinyint_e23 using mt_tinyint tags (033) values (now, "abc")
|
||||
sql_error insert into st_tinyint_e24 using mt_tinyint tags (033) values (now, " ")
|
||||
sql insert into st_tinyint_e25_2 using mt_tinyint tags (033) values (now, '')
|
||||
sql_error insert into st_tinyint_e22 using mt_tinyint tags (033) values (now, abc)
|
||||
sql_error insert into st_tinyint_e23 using mt_tinyint tags (033) values (now, "abc")
|
||||
sql_error insert into st_tinyint_e24 using mt_tinyint tags (033) values (now, " ")
|
||||
sql insert into st_tinyint_e25_2 using mt_tinyint tags (033) values (now, '')
|
||||
|
||||
sql_error insert into st_tinyint_e13 using mt_tinyint tags (128) values (now, -033)
|
||||
sql insert into st_tinyint_e14 using mt_tinyint tags (-128) values (now, -033)
|
||||
|
@ -414,15 +414,15 @@ sql insert into st_tinyint_e23 using mt_tinyint tags (033) values (now, 00062)
|
|||
sql insert into st_tinyint_e24 using mt_tinyint tags (033) values (now, 00062)
|
||||
sql insert into st_tinyint_e25 using mt_tinyint tags (033) values (now, 00062)
|
||||
|
||||
sql_error alter table st_tinyint_e13 set tag tagname=128
|
||||
sql alter table st_tinyint_e14 set tag tagname=-128
|
||||
sql_error alter table st_tinyint_e15 set tag tagname=1280
|
||||
sql_error alter table st_tinyint_e16 set tag tagname=-1280
|
||||
sql_error alter table st_tinyint_e19 set tag tagname=123abc
|
||||
sql_error alter table st_tinyint_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_tinyint_e22 set tag tagname=abc
|
||||
sql_error alter table st_tinyint_e23 set tag tagname="abc"
|
||||
sql_error alter table st_tinyint_e24 set tag tagname=" "
|
||||
sql alter table st_tinyint_e25 set tag tagname=''
|
||||
sql_error alter table st_tinyint_e13 set tag tagname=128
|
||||
sql alter table st_tinyint_e14 set tag tagname=-128
|
||||
sql_error alter table st_tinyint_e15 set tag tagname=1280
|
||||
sql_error alter table st_tinyint_e16 set tag tagname=-1280
|
||||
sql_error alter table st_tinyint_e19 set tag tagname=123abc
|
||||
sql_error alter table st_tinyint_e20 set tag tagname="123abc"
|
||||
sql_error alter table st_tinyint_e22 set tag tagname=abc
|
||||
sql_error alter table st_tinyint_e23 set tag tagname="abc"
|
||||
sql_error alter table st_tinyint_e24 set tag tagname=" "
|
||||
sql alter table st_tinyint_e25 set tag tagname=''
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -9,7 +9,7 @@ $stbPrefix = sc_stb
|
|||
$tbNum = 10
|
||||
$rowNum = 10000
|
||||
$totalNum = $tbNum * $rowNum
|
||||
$loops = 5
|
||||
$loops = 5
|
||||
$log = 1
|
||||
$ts0 = 1537146000000
|
||||
$delta = 600000
|
||||
|
@ -34,7 +34,7 @@ while $i < $halfNum
|
|||
$tb1 = $tbPrefix . $tbId
|
||||
sql create table $tb using $stb tags( $i )
|
||||
sql create table $tb1 using $stb tags( $tbId )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -48,10 +48,10 @@ while $i < $halfNum
|
|||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
sql use $db
|
||||
|
@ -62,7 +62,7 @@ $i = 0
|
|||
while $loop <= $loops
|
||||
print repeat = $loop
|
||||
while $i < 10
|
||||
sql select count(*) from $stb where t1 = $i
|
||||
sql select count(*) from $stb where t1 = $i
|
||||
if $data00 != $rowNum then
|
||||
print expect $rowNum , actual: $data00
|
||||
return -1
|
||||
|
@ -89,7 +89,7 @@ $i = 0
|
|||
while $loop <= $loops
|
||||
print repeat = $loop
|
||||
while $i < 10
|
||||
sql select count(*) from $stb where t1 = $i
|
||||
sql select count(*) from $stb where t1 = $i
|
||||
if $data00 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
|
@ -102,4 +102,4 @@ while $loop <= $loops
|
|||
$loop = $loop + 1
|
||||
endw
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -4,7 +4,7 @@ system sh/exec.sh -n dnode1 -s start
|
|||
sql connect
|
||||
|
||||
sql drop database if exists cdb
|
||||
sql create database if not exists cdb
|
||||
sql create database if not exists cdb
|
||||
sql use cdb
|
||||
sql create table stb1 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(10), t3 double)
|
||||
sql create table tb1 using stb1 tags(1,'1',1.0)
|
||||
|
@ -37,7 +37,7 @@ sql insert into tb4 values ('2021-05-05 18:19:19',44,44.0,44,44,44,44.0,false,'4
|
|||
sql insert into tb5 values ('2021-05-05 18:19:20',51,51.0,51,51,51,51.0,true ,'51','51')
|
||||
sql insert into tb5 values ('2021-05-05 18:19:21',52,52.0,52,52,52,52.0,true ,'52','52')
|
||||
sql insert into tb5 values ('2021-05-05 18:19:22',53,53.0,53,53,53,53.0,false,'53','53')
|
||||
sql insert into tb5 values ('2021-05-05 18:19:23',54,54.0,54,54,54,54.0,false,'54','54')
|
||||
sql insert into tb5 values ('2021-05-05 18:19:23',54,54.0,54,54,54,54.0,false,'54','54')
|
||||
sql insert into tb6 values ('2021-05-05 18:19:24',61,61.0,61,61,61,61.0,true ,'61','61')
|
||||
sql insert into tb6 values ('2021-05-05 18:19:25',62,62.0,62,62,62,62.0,true ,'62','62')
|
||||
sql insert into tb6 values ('2021-05-05 18:19:26',63,63.0,63,63,63,63.0,false,'63','63')
|
||||
|
|
|
@ -23,10 +23,10 @@ sql create database $db
|
|||
sql use $db
|
||||
sql show databases
|
||||
|
||||
if $rows != 3 then
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != $db then
|
||||
if $data20 != $db then
|
||||
return -1
|
||||
endi
|
||||
sql drop database $db
|
||||
|
@ -41,7 +41,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != $db then
|
||||
if $data20 != $db then
|
||||
return -1
|
||||
endi
|
||||
sql drop database $db
|
||||
|
@ -101,7 +101,7 @@ $duration = 10
|
|||
$keep = 365,365,365
|
||||
$rows_db = 1000
|
||||
$cache = 16 # 16MB
|
||||
$ablocks = 100
|
||||
$ablocks = 100
|
||||
$tblocks = 32 # max=512, automatically trimmed when exceeding
|
||||
$ctime = 36000 # 10 hours
|
||||
$wal = 1 # valid value is 1, 2
|
||||
|
@ -112,16 +112,16 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != $db then
|
||||
if $data20 != $db then
|
||||
return -1
|
||||
endi
|
||||
if $data24 != $replica then
|
||||
if $data24 != $replica then
|
||||
return -1
|
||||
endi
|
||||
if $data26 != 14400m then
|
||||
if $data26 != 14400m then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 525600m,525600m,525600m then
|
||||
if $data27 != 525600m,525600m,525600m then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -134,7 +134,7 @@ sql_error create database $db replica 4
|
|||
|
||||
# day [1, 3650]
|
||||
sql_error create database $db day 0
|
||||
sql_error create database $db day 3651
|
||||
sql_error create database $db day 3651
|
||||
|
||||
# keep [1, infinity]
|
||||
sql_error create database $db keep 0
|
||||
|
@ -155,7 +155,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 27360m,27360m,27360m then
|
||||
if $data27 != 27360m,27360m,27360m then
|
||||
return -1
|
||||
endi
|
||||
sql drop database dbk0
|
||||
|
@ -164,7 +164,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 27360m,28800m,28800m then
|
||||
if $data27 != 27360m,28800m,28800m then
|
||||
return -1
|
||||
endi
|
||||
sql drop database dbka
|
||||
|
@ -174,7 +174,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 15840m,15840m,15840m then
|
||||
if $data27 != 15840m,15840m,15840m then
|
||||
return -1
|
||||
endi
|
||||
sql drop database dbk1
|
||||
|
@ -183,7 +183,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 15840m,17280m,18720m then
|
||||
if $data27 != 15840m,17280m,18720m then
|
||||
return -1
|
||||
endi
|
||||
sql drop database dbk2
|
||||
|
@ -192,7 +192,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 15840m,15840m,18720m then
|
||||
if $data27 != 15840m,15840m,18720m then
|
||||
return -1
|
||||
endi
|
||||
sql drop database dbk3
|
||||
|
@ -201,7 +201,7 @@ sql show databases
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data27 != 15840m,18720m,18720m then
|
||||
if $data27 != 15840m,18720m,18720m then
|
||||
return -1
|
||||
endi
|
||||
sql drop database dbk4
|
||||
|
@ -238,7 +238,7 @@ if $rows != 3 then
|
|||
endi
|
||||
sql show databases
|
||||
print wallevel $data20_testwal
|
||||
if $data20_testwal != 1 then
|
||||
if $data20_testwal != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql drop database testwal
|
||||
|
@ -249,7 +249,7 @@ if $rows != 3 then
|
|||
return -1
|
||||
endi
|
||||
print wallevel $data13_testwal
|
||||
if $data13_testwal != 2 then
|
||||
if $data13_testwal != 2 then
|
||||
return -1
|
||||
endi
|
||||
sql drop database testwal
|
||||
|
@ -263,7 +263,7 @@ sql_error create database $db comp 3
|
|||
|
||||
sql_error drop database $db
|
||||
sql show databases
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ sql show stables
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != $mt then
|
||||
if $data00 != $mt then
|
||||
return -1
|
||||
endi
|
||||
sql_error DROP METRIC $mt
|
||||
|
@ -75,7 +75,7 @@ sql_error create table $mt (ts timestamp, col $i_tinyint ) tags (tag1 int)
|
|||
sql_error create table $mt (ts timestamp, col $i_nchar ) tags (tag1 int)
|
||||
|
||||
# correct using of nchar
|
||||
sql create table $mt (ts timestamp, col nchar(10)) tags (tag1 int)
|
||||
sql create table $mt (ts timestamp, col nchar(10)) tags (tag1 int)
|
||||
sql show stables
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
|
@ -115,7 +115,7 @@ endi
|
|||
if $data00 != $mt then
|
||||
return -1
|
||||
endi
|
||||
sql drop table $mt
|
||||
sql drop table $mt
|
||||
print illegal_data_type_in_tags test passed
|
||||
|
||||
# illegal_tag_name test
|
||||
|
@ -141,12 +141,12 @@ $stables = stables
|
|||
sql_error create table $mt (ts timestamp, col1 int) tags ( $tb_ int)
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $tbs int)
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $db_ int)
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $dbs int)
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $dbs int)
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $ses int)
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $int int)
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $bint int)
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $binary int)
|
||||
sql create table $mt (ts timestamp, col1 int) tags ( $str int)
|
||||
sql create table $mt (ts timestamp, col1 int) tags ( $str int)
|
||||
sql drop table $mt
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $tag int)
|
||||
sql_error create table $mt (ts timestamp, col1 int) tags ( $tags int)
|
||||
|
@ -184,7 +184,7 @@ sql drop table $tb
|
|||
|
||||
sql_error create table $tb using $mt tags (abc)
|
||||
#the case below might need more consideration
|
||||
sql_error create table $tb using $mt tags ('abc')
|
||||
sql_error create table $tb using $mt tags ('abc')
|
||||
sql drop table if exists $tb
|
||||
sql reset query cache
|
||||
sql_error create table $tb using $mt tags (1e1)
|
||||
|
@ -202,12 +202,12 @@ $mt2 = mt2
|
|||
#sql_error create table $mt1 (ts timestamp, $CN_char int) tags (tag1 int)
|
||||
#sql_error create table $mt2 (ts timestamp, col1 int) tags ( $CN_char int)
|
||||
#sql show metrics
|
||||
#if $rows != 3 then
|
||||
#if $rows != 3 then
|
||||
# return -1
|
||||
#endi
|
||||
##print expected: $CN_char
|
||||
##print returned: $data00
|
||||
#if $data00 != $CN_char then
|
||||
#if $data00 != $CN_char then
|
||||
# return -1
|
||||
#endi
|
||||
##print expected: $mt1
|
||||
|
@ -241,7 +241,7 @@ print chinese_char_in_metrics test passed
|
|||
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ if $rows != 1 then
|
|||
return -1
|
||||
endi
|
||||
print data00 = $data00
|
||||
if $data00 != $tb then
|
||||
if $data00 != $tb then
|
||||
return -1
|
||||
endi
|
||||
sql DROP TABLE $tb
|
||||
|
@ -47,7 +47,7 @@ print =========== create_tb.sim case2: illegal_table_name test
|
|||
$illegal_tb1 = 1db
|
||||
$illegal_tb2 = d@b
|
||||
|
||||
sql_error create table $illegal_db1 (ts timestamp, tcol int)
|
||||
sql_error create table $illegal_db1 (ts timestamp, tcol int)
|
||||
sql_error create table $illegal_db2 (ts timestamp, tcol int)
|
||||
print illegal_table_name test passed
|
||||
|
||||
|
@ -99,19 +99,19 @@ $tint = tinyint
|
|||
$nchar = nchar
|
||||
|
||||
sql_error create table $tb (ts timestamp, $tb_ int)
|
||||
sql_error create table $tb (ts timestamp, $tbs int)
|
||||
sql_error create table $tb (ts timestamp, $db_ int)
|
||||
sql_error create table $tb (ts timestamp, $tbs int)
|
||||
sql_error create table $tb (ts timestamp, $db_ int)
|
||||
sql_error create table $tb (ts timestamp, $dbs int)
|
||||
sql_error create table $tb (ts timestamp, $ses int)
|
||||
sql_error create table $tb (ts timestamp, $int int)
|
||||
sql_error create table $tb (ts timestamp, $bint int)
|
||||
sql_error create table $tb (ts timestamp, $binary int)
|
||||
sql create table $tb (ts timestamp, $str int)
|
||||
sql_error create table $tb (ts timestamp, $bint int)
|
||||
sql_error create table $tb (ts timestamp, $binary int)
|
||||
sql create table $tb (ts timestamp, $str int)
|
||||
sql drop table $tb
|
||||
sql_error create table $tb (ts timestamp, $tag int)
|
||||
sql_error create table $tb (ts timestamp, $tag int)
|
||||
sql_error create table $tb (ts timestamp, $tags int)
|
||||
sql_error create table $tb (ts timestamp, $sint int)
|
||||
sql_error create table $tb (ts timestamp, $tint int)
|
||||
sql_error create table $tb (ts timestamp, $sint int)
|
||||
sql_error create table $tb (ts timestamp, $tint int)
|
||||
sql_error create table $tb (ts timestamp, $nchar int)
|
||||
|
||||
# too long column name
|
||||
|
@ -124,23 +124,23 @@ print ========== create_tb.sim case5: chinese_char_in_table_support test
|
|||
|
||||
$CN_char = 涛思
|
||||
$tb1 = tb1
|
||||
sql_error create table $CN_char (ts timestamp, col1 int)
|
||||
#sql show tables
|
||||
#if $rows != 1 then
|
||||
sql_error create table $CN_char (ts timestamp, col1 int)
|
||||
#sql show tables
|
||||
#if $rows != 1 then
|
||||
# return -1
|
||||
#endi
|
||||
#print expected: $CN_char
|
||||
#print returned: $data00
|
||||
#if $data00 != $CN_char then
|
||||
#if $data00 != $CN_char then
|
||||
# return -1
|
||||
#endi
|
||||
#sql drop table $CN_char
|
||||
|
||||
sql_error create table $tb1 (ts timestamp, $CN_char int)
|
||||
sql_error create table $tb1 (ts timestamp, $CN_char int)
|
||||
#print expected: $tb1
|
||||
#print returned: $data10
|
||||
#sql show tables
|
||||
#if $rows != 1 then
|
||||
#if $rows != 1 then
|
||||
# return -1
|
||||
#endi
|
||||
#if $data00 != $tb1 then
|
||||
|
@ -181,8 +181,8 @@ print table_already_exists test passed
|
|||
|
||||
sql drop database $db
|
||||
sql show 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
|
||||
|
|
|
@ -15,16 +15,16 @@ sql select id,t1,t2,t3 from tb1
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1 then
|
||||
if $data00 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != NULL then
|
||||
if $data02 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != NULL then
|
||||
if $data03 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -33,16 +33,16 @@ sql show tags from tb2
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != NULL then
|
||||
if $data05 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != NULL then
|
||||
if $data15 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 12 then
|
||||
if $data25 != 12 then
|
||||
return -1
|
||||
endi
|
||||
if $data35 != 22.000000000 then
|
||||
if $data35 != 22.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -51,16 +51,16 @@ sql show tags from tb3;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != 2 then
|
||||
if $data15 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 3 then
|
||||
if $data25 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data35 != 33.000000000 then
|
||||
if $data35 != 33.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -69,16 +69,16 @@ sql show tags from tb4;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != 2 then
|
||||
if $data15 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 33 then
|
||||
if $data25 != 33 then
|
||||
return -1
|
||||
endi
|
||||
if $data35 != 44.000000000 then
|
||||
if $data35 != 44.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -96,16 +96,16 @@ sql show tags from tb12;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != 2 then
|
||||
if $data15 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != NULL then
|
||||
if $data25 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data35 != NULL then
|
||||
if $data35 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -114,16 +114,16 @@ sql show tags from tb13;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != 2 then
|
||||
if $data15 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != NULL then
|
||||
if $data25 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data35 != NULL then
|
||||
if $data35 != NULL then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -85,18 +85,18 @@ sql insert into abc.tk_subt001 (ts, b, d) values (now-1m, 'binary_6',
|
|||
sql insert into abc.tk_subt001 (ts, b, d) values (now-1s, 'binary_7', 1.007)
|
||||
sql insert into abc.tk_subt001 (ts, b, d) values (now-1a, 'binary_8', 1.008)
|
||||
sql select * from tk_subt001
|
||||
if $rows != 6 then
|
||||
if $rows != 6 then
|
||||
print ==== expect rows is 6, but actually is $rows
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql insert into abc.tk_subt002 using tk_mt tags (22, 'subt002x') values (now+1s, 2001, 'binary_2001', true, 2001.001, 2001.001, 'nchar_2001')
|
||||
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1m, 2002, 'binary_2002', false, 2002.001, 2002.001, 'nchar_2002')
|
||||
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1m, 2002, 'binary_2002', false, 2002.001, 2002.001, 'nchar_2002')
|
||||
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1h, 2003, 'binary_2003', false, 2003.001, 2003.001, 'nchar_2003')
|
||||
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1d, 2004, 'binary_2004', true, 2004.001, 2004.001, 'nchar_2004')
|
||||
sql insert into abc.tk_subt002 using tk_mt tags (2, 'subt002') values (now+1w, 2005, 'binary_2005', false, 2005.001, 2005.001, 'nchar_2005')
|
||||
sql select * from tk_subt002
|
||||
if $rows != 5 then
|
||||
if $rows != 5 then
|
||||
print ==== expect rows is 5, but actually is $rows
|
||||
return -1
|
||||
endi
|
||||
|
@ -106,7 +106,7 @@ sql insert into abc.tk_subt003 (ts, a, c, e, f) using tk_mt tags (3, 'subt003')
|
|||
sql insert into abc.tk_subt003 values (now-36d, 3006, 'binary_3006', true, 3006.001, 3006.001, 'nchar_3006')
|
||||
sql insert into abc.tk_subt003 (ts, a, c, e, f) using tk_mt tags (33, 'subt003x') values (now-35d, 3007, false, 3007.001, 'nchar_3007')
|
||||
sql select * from tk_subt003
|
||||
if $rows != 4 then
|
||||
if $rows != 4 then
|
||||
print ==== expect rows is 4, but actually is $rows
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -34,11 +34,11 @@ while $i < $tbNum
|
|||
sql insert into $tb values('2015-08-18 00:18:00', 4);
|
||||
sql insert into $tb values('2015-08-18 00:24:00', 5);
|
||||
sql insert into $tb values('2015-08-18 00:30:00', 6);
|
||||
endw
|
||||
endw
|
||||
$i = 0
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
print ====== table created
|
||||
print ====== table created
|
||||
|
||||
#### select distinct tag
|
||||
sql select distinct t1 from $stb
|
||||
|
@ -66,17 +66,17 @@ if $rows != 6 then
|
|||
endi
|
||||
|
||||
### select multi normal column
|
||||
### select distinct multi column on sub table
|
||||
### select distinct multi column on sub table
|
||||
|
||||
sql select distinct ts, c1 from $tb
|
||||
if $rows != 6 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
### select distinct
|
||||
### select distinct
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -27,17 +27,17 @@ $ts = $ts0
|
|||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
$ts = $ts0 + $xs
|
||||
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , true, 'BINARY', 'NCHAR' )
|
||||
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , true, 'BINARY', 'NCHAR' )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
# setup
|
||||
$i = 0
|
||||
|
@ -72,7 +72,7 @@ endi
|
|||
if $data13 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
# unspecified filling method
|
||||
sql_error select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill (6, 6, 6, 6, 6)
|
||||
|
||||
|
@ -81,31 +81,31 @@ sql_error select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb w
|
|||
print constant_fill test
|
||||
print count_with_constant_fill
|
||||
sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 1 then
|
||||
|
@ -115,31 +115,31 @@ endi
|
|||
# avg_with_fill
|
||||
print avg_with_constant_fill
|
||||
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6.000000000 then
|
||||
if $data11 != 6.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6.000000000 then
|
||||
if $data31 != 6.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6.000000000 then
|
||||
if $data51 != 6.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6.000000000 then
|
||||
if $data71 != 6.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4.000000000 then
|
||||
|
@ -149,31 +149,31 @@ endi
|
|||
# max_with_fill
|
||||
print max_with_fill
|
||||
sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -183,31 +183,31 @@ endi
|
|||
# min_with_fill
|
||||
print min_with_fill
|
||||
sql select _wstart, min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -217,31 +217,31 @@ endi
|
|||
# first_with_fill
|
||||
print first_with_fill
|
||||
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -306,32 +306,32 @@ endi
|
|||
# last_with_fill
|
||||
print last_with_fill
|
||||
sql select _wstart, last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
print expect 0, actual:$data01
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -340,13 +340,13 @@ endi
|
|||
|
||||
# fill_negative_values
|
||||
sql select _wstart, sum(c1), avg(c2), max(c3), min(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -1, -1, -1, -1, -1, -1, -1)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != -1 then
|
||||
if $data11 != -1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -401,7 +401,7 @@ sql select count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(v
|
|||
|
||||
print select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e1');
|
||||
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e1');
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
|
@ -409,7 +409,7 @@ if $data01 != 1 then
|
|||
endi
|
||||
|
||||
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1e1);
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
|
@ -417,7 +417,7 @@ if $data01 != 1 then
|
|||
endi
|
||||
|
||||
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '10');
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
|
@ -431,31 +431,31 @@ endi
|
|||
## previous fill
|
||||
print fill(prev)
|
||||
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 1 then
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 1 then
|
||||
if $data51 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 1 then
|
||||
if $data71 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 1 then
|
||||
|
@ -464,31 +464,31 @@ endi
|
|||
|
||||
# avg_with_fill
|
||||
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0.000000000 then
|
||||
if $data11 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1.000000000 then
|
||||
if $data31 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2.000000000 then
|
||||
if $data51 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3.000000000 then
|
||||
if $data71 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4.000000000 then
|
||||
|
@ -497,31 +497,31 @@ endi
|
|||
|
||||
# max_with_fill
|
||||
sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0 then
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3 then
|
||||
if $data71 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -530,31 +530,31 @@ endi
|
|||
|
||||
# min_with_fill
|
||||
sql select _wstart, min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0 then
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3 then
|
||||
if $data71 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -563,31 +563,31 @@ endi
|
|||
|
||||
# first_with_fill
|
||||
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0 then
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3 then
|
||||
if $data71 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -596,31 +596,31 @@ endi
|
|||
|
||||
# last_with_fill
|
||||
sql select _wstart, last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0 then
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3 then
|
||||
if $data71 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -633,7 +633,7 @@ print fill(value, NULL)
|
|||
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
print select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
|
@ -664,13 +664,13 @@ if $data81 != 1 then
|
|||
return -1
|
||||
endi
|
||||
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(none)
|
||||
if $rows != 5 then
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
# avg_with_fill
|
||||
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0.000000000 then
|
||||
|
@ -703,7 +703,7 @@ endi
|
|||
|
||||
# max_with_fill
|
||||
sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -736,7 +736,7 @@ endi
|
|||
|
||||
# min_with_fill
|
||||
sql select _wstart, min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -769,7 +769,7 @@ endi
|
|||
|
||||
# first_with_fill
|
||||
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -802,7 +802,7 @@ endi
|
|||
|
||||
# last_with_fill
|
||||
sql select _wstart, last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
|
|
@ -35,7 +35,7 @@ while $i < $halfNum
|
|||
$tgstr1 = $tgstr1 . '
|
||||
sql create table $tb using $stb tags( $i , $tgstr , $tgstr , $i , $i , $i )
|
||||
sql create table $tb1 using $stb tags( $i1 , $tgstr1 , $tgstr1 , $i , $i , $i )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -47,13 +47,13 @@ while $i < $halfNum
|
|||
$binary = $binary . '
|
||||
$nchar = 'nchar . $c
|
||||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
# setup
|
||||
|
@ -167,7 +167,7 @@ endi
|
|||
if $data13 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
# unspecified filling method
|
||||
sql_error select max(c1), max(c2), max(c3), max(c4), max(c5) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill (6, 6, 6, 6, 6)
|
||||
|
||||
|
@ -245,35 +245,35 @@ sql_error select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m)
|
|||
sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '2e1');
|
||||
$val = $rowNum * 2
|
||||
$val = $val - 1
|
||||
if $rows != $val then
|
||||
if $rows != $val then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 20 then
|
||||
if $data11 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 2e1);
|
||||
if $rows != $val then
|
||||
if $rows != $val then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 20 then
|
||||
if $data11 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '20');
|
||||
if $rows != $val then
|
||||
if $rows != $val then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 20 then
|
||||
if $data11 != 20 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -358,7 +358,7 @@ endi
|
|||
## previous fill
|
||||
print fill(prev)
|
||||
sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(prev) group by t1 limit 5
|
||||
if $rows != 25 then
|
||||
if $rows != 25 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -370,19 +370,19 @@ endi
|
|||
if $data04 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data09 != 5 then
|
||||
if $data09 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data19 != 5 then
|
||||
if $data19 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data18 != nchar0 then
|
||||
return -1
|
||||
endi
|
||||
if $data59 != 6 then
|
||||
if $data59 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data69 != 6 then
|
||||
|
@ -392,7 +392,7 @@ endi
|
|||
## NULL fill
|
||||
print fill(NULL)
|
||||
sql select max(c1), min(c2), avg(c3), sum(c4), count(c5), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 4 interval(5m) fill(value, NULL) group by t1 limit 5
|
||||
if $rows != 25 then
|
||||
if $rows != 25 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -407,7 +407,7 @@ endi
|
|||
if $data06 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data09 != 5 then
|
||||
if $data09 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != NULL then
|
||||
|
@ -416,13 +416,13 @@ endi
|
|||
if $data12 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data19 != 5 then
|
||||
if $data19 != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data18 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data59 != 6 then
|
||||
if $data59 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data69 != 6 then
|
||||
|
@ -432,8 +432,8 @@ endi
|
|||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -27,17 +27,17 @@ $ts = $ts0
|
|||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $mt tags( $i )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
$ts = $ts0 + $xs
|
||||
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , true, 'BINARY', 'NCHAR' )
|
||||
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , true, 'BINARY', 'NCHAR' )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
# setup
|
||||
$i = 0
|
||||
|
@ -74,7 +74,7 @@ endi
|
|||
if $data13 != 6.00000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
# unspecified filling method
|
||||
sql_error select max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill (6, 6, 6, 6, 6)
|
||||
|
||||
|
@ -84,31 +84,31 @@ print constant_fill test
|
|||
print count_with_constant_fill
|
||||
print sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
|
||||
sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 1 then
|
||||
|
@ -118,31 +118,31 @@ endi
|
|||
# avg_with_fill
|
||||
print avg_witt_constant_fill
|
||||
sql select avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6.000000000 then
|
||||
if $data11 != 6.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6.000000000 then
|
||||
if $data31 != 6.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6.000000000 then
|
||||
if $data51 != 6.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6.000000000 then
|
||||
if $data71 != 6.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4.000000000 then
|
||||
|
@ -152,31 +152,31 @@ endi
|
|||
# max_with_fill
|
||||
print max_with_fill
|
||||
sql select max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -186,31 +186,31 @@ endi
|
|||
# min_with_fill
|
||||
print min_with_fill
|
||||
sql select min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -220,31 +220,31 @@ endi
|
|||
# first_with_fill
|
||||
print first_with_fill
|
||||
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -309,31 +309,31 @@ endi
|
|||
# last_with_fill
|
||||
print last_with_fill
|
||||
sql select last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 6, 6, 6, 6, 6, 6, 6, 6)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 6 then
|
||||
if $data11 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 6 then
|
||||
if $data31 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 6 then
|
||||
if $data51 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 6 then
|
||||
if $data71 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -342,13 +342,13 @@ endi
|
|||
|
||||
# fill_negative_values
|
||||
sql select _wstart, sum(c1), avg(c2), max(c3), min(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -1, -1, -1, -1, -1, -1, -1)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != -1 then
|
||||
if $data11 != -1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -401,7 +401,7 @@ sql_error select count(*) where ts >= $ts0 and ts <= $tsu interval(5m) fill(valu
|
|||
sql select count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 'true');
|
||||
|
||||
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '1e1');
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
|
@ -409,7 +409,7 @@ if $data01 != 1 then
|
|||
endi
|
||||
|
||||
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, 1e1);
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
|
@ -417,7 +417,7 @@ if $data01 != 1 then
|
|||
endi
|
||||
|
||||
sql select _wstart, count(*) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, '10');
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
|
@ -432,31 +432,31 @@ endi
|
|||
## previous fill
|
||||
print fill(prev)
|
||||
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 1 then
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 1 then
|
||||
if $data51 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 1 then
|
||||
if $data71 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 1 then
|
||||
|
@ -465,31 +465,31 @@ endi
|
|||
|
||||
# avg_with_fill
|
||||
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0.000000000 then
|
||||
if $data11 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1.000000000 then
|
||||
if $data31 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2.000000000 then
|
||||
if $data51 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3.000000000 then
|
||||
if $data71 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4.000000000 then
|
||||
|
@ -498,31 +498,31 @@ endi
|
|||
|
||||
# max_with_fill
|
||||
sql select max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0 then
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3 then
|
||||
if $data71 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -531,31 +531,31 @@ endi
|
|||
|
||||
# min_with_fill
|
||||
sql select min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0 then
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3 then
|
||||
if $data71 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -564,31 +564,31 @@ endi
|
|||
|
||||
# first_with_fill
|
||||
sql select first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0 then
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3 then
|
||||
if $data71 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -597,31 +597,31 @@ endi
|
|||
|
||||
# last_with_fill
|
||||
sql select last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(prev)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0 then
|
||||
if $data11 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 1 then
|
||||
if $data31 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != 2 then
|
||||
if $data51 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data61 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data71 != 3 then
|
||||
if $data71 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data81 != 4 then
|
||||
|
@ -634,7 +634,7 @@ print fill(value, NULL)
|
|||
sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
print select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
sql select _wstart, count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
|
@ -665,13 +665,13 @@ if $data81 != 1 then
|
|||
return -1
|
||||
endi
|
||||
sql select count(c1), count(c2), count(c3), count(c4), count(c5), count(c6), count(c7), count(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(none)
|
||||
if $rows != 5 then
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
# avg_with_fill
|
||||
sql select _wstart, avg(c1), avg(c2), avg(c3), avg(c4), avg(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0.000000000 then
|
||||
|
@ -704,7 +704,7 @@ endi
|
|||
|
||||
# max_with_fill
|
||||
sql select _wstart, max(c1), max(c2), max(c3), max(c4), max(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -737,7 +737,7 @@ endi
|
|||
|
||||
# min_with_fill
|
||||
sql select _wstart, min(c1), min(c2), min(c3), min(c4), min(c5) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -770,7 +770,7 @@ endi
|
|||
|
||||
# first_with_fill
|
||||
sql select _wstart, first(c1), first(c2), first(c3), first(c4), first(c5), first(c6), first(c7), first(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill( NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -803,7 +803,7 @@ endi
|
|||
|
||||
# last_with_fill
|
||||
sql select _wstart, last(c1), last(c2), last(c3), last(c4), last(c5), last(c6), last(c7), last(c8) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) fill(NULL)
|
||||
if $rows != 9 then
|
||||
if $rows != 9 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -845,7 +845,7 @@ endi
|
|||
#print =============== clear
|
||||
#sql drop database $db
|
||||
#sql show databases
|
||||
#if $rows != 0 then
|
||||
#if $rows != 0 then
|
||||
# return -1
|
||||
#endi
|
||||
|
||||
|
@ -880,7 +880,7 @@ sql insert into us_t1 values ('2018-09-17 09:00:00.000029', 29 , 29)
|
|||
|
||||
print sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(value, 999, 999)
|
||||
sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(value, 999, 999)
|
||||
if $rows != 8 then
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2.000000000 then
|
||||
|
@ -909,7 +909,7 @@ if $data71 != 21.000000000 then
|
|||
endi
|
||||
|
||||
sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(none)
|
||||
if $rows != 6 then
|
||||
if $rows != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2.000000000 then
|
||||
|
@ -932,7 +932,7 @@ if $data51 != 21.000000000 then
|
|||
endi
|
||||
|
||||
sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(null)
|
||||
if $rows != 8 then
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2.000000000 then
|
||||
|
@ -965,7 +965,7 @@ endi
|
|||
|
||||
|
||||
sql select avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(prev)
|
||||
if $rows != 8 then
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2.000000000 then
|
||||
|
@ -994,7 +994,7 @@ if $data71 != 21.000000000 then
|
|||
endi
|
||||
|
||||
sql select _wstart, avg(c1), avg(c2) from us_t1 where ts >= '2018-09-17 09:00:00.000002' and ts <= '2018-09-17 09:00:00.000021' interval(3u) fill(linear)
|
||||
if $rows != 8 then
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2.000000000 then
|
||||
|
@ -1022,4 +1022,4 @@ if $data71 != 21.000000000 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
print ======== fill_us.sim run end...... ================
|
||||
print ======== fill_us.sim run end...... ================
|
||||
|
|
|
@ -19,7 +19,7 @@ $stb = $stbPrefix . $i
|
|||
sql drop database $db -x step1
|
||||
step1:
|
||||
|
||||
sql create database $db maxrows 400
|
||||
sql create database $db maxrows 400
|
||||
|
||||
sql use $db
|
||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
|
||||
|
@ -29,18 +29,18 @@ $ts = $ts0
|
|||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
$ts = $ts0 + $xs
|
||||
$c6 = $x / 128
|
||||
$c6 = $x / 128
|
||||
$c6 = $c6 * 128
|
||||
$c6 = $x - $c6
|
||||
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , $c6 , true, 'BINARY', 'NCHAR' )
|
||||
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x , $c6 , true, 'BINARY', 'NCHAR' )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
|
|
|
@ -29,22 +29,22 @@ if $data00 != @18-09-17 08:59:00.000@ then
|
|||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 0 then
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
print data03 = $data03
|
||||
if $data03 != 0.00000 then
|
||||
print expect 0.00000, actual: $data03
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 0 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data06 != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -66,20 +66,20 @@ if $rows != 1 then
|
|||
return -1
|
||||
endi
|
||||
if $data00 != @18-09-18 01:40:00.000@ then
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data01 != 999 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data02 != 999 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data03 != 999.00000 then
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
|
||||
if $data04 != 999.000000000 then
|
||||
return -1
|
||||
|
@ -88,7 +88,7 @@ endi
|
|||
#if $data05 != NULL then
|
||||
if $data05 != 999 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
#if $data06 != NULL then
|
||||
if $data06 != 103 then
|
||||
return -1
|
||||
|
@ -108,8 +108,8 @@ endi
|
|||
|
||||
### test if first works for committed data. An 'order by ts desc' clause should be present, and queried data should come from at least 2 file blocks
|
||||
$tb = $tbPrefix . 9
|
||||
sql select first(ts), first(c1) from $tb where ts < '2018-10-17 10:00:00.000'
|
||||
if $rows != 1 then
|
||||
sql select first(ts), first(c1) from $tb where ts < '2018-10-17 10:00:00.000'
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @18-09-17 09:00:00.000@ then
|
||||
|
@ -121,7 +121,7 @@ endi
|
|||
|
||||
$tb = $tbPrefix . 9
|
||||
sql select first(ts), first(c1) from $tb where ts < '2018-10-17 10:00:00.000'
|
||||
if $rows != 1 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @18-09-17 09:00:00.000@ then
|
||||
|
|
|
@ -18,7 +18,7 @@ print =============== create super table
|
|||
sql create table if not exists stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double) tags (t1 int)
|
||||
|
||||
sql show stables
|
||||
if $rows != 1 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -28,7 +28,7 @@ sql create table ct0 using stb tags(1000)
|
|||
#sql create table ct3 using stb tags(3000)
|
||||
|
||||
sql show tables
|
||||
if $rows != 1 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -63,7 +63,7 @@ $loop_test = 0
|
|||
loop_test_pos:
|
||||
|
||||
sql select ts, c2-c1, c3/c1, c4+c1, c1*9, c1%3 from ct0
|
||||
print ===> rows: $rows
|
||||
print ===> rows: $rows
|
||||
print ===> $data00 $data01 $data02 $data03 $data04 $data05
|
||||
print ===> $data10 $data11 $data12 $data13 $data14 $data15
|
||||
print ===> $data20 $data21 $data22 $data23 $data24 $data25
|
||||
|
@ -96,15 +96,15 @@ if $loop_test == 0 then
|
|||
print =============== stop and restart taosd
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
|
||||
$loop_cnt = 0
|
||||
check_dnode_ready_0:
|
||||
$loop_cnt = $loop_cnt + 1
|
||||
sleep 200
|
||||
if $loop_cnt == 10 then
|
||||
print ====> dnode not ready!
|
||||
return -1
|
||||
endi
|
||||
$loop_cnt = $loop_cnt + 1
|
||||
sleep 200
|
||||
if $loop_cnt == 10 then
|
||||
print ====> dnode not ready!
|
||||
return -1
|
||||
endi
|
||||
sql show dnodes
|
||||
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
|
||||
if $data00 != 1 then
|
||||
|
@ -114,7 +114,7 @@ if $loop_test == 0 then
|
|||
goto check_dnode_ready_0
|
||||
endi
|
||||
|
||||
$loop_test = 1
|
||||
$loop_test = 1
|
||||
goto loop_test_pos
|
||||
endi
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ if $data13 != 1 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select _wstart, twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:07:00' interval(1m)
|
||||
sql select _wstart, twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:07:00' interval(1m)
|
||||
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
|
||||
print $data10 $data11 $data12 $data13 $data14 $data15 $data16
|
||||
print $data20 $data21 $data22 $data23 $data24 $data25 $data26
|
||||
|
@ -114,7 +114,7 @@ if $data01 != 2.068333156 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select _wstart, twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:27:00' interval(10m)
|
||||
sql select _wstart, twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:27:00' interval(10m)
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -190,8 +190,8 @@ if $rows != 0 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:30:00' interval(10m)
|
||||
sql select twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:30:00' interval(10m)
|
||||
sql select twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:30:00' interval(10m)
|
||||
sql select twa(k),avg(k),count(1) from t1 where ts>='2015-8-18 00:00:00' and ts<='2015-8-18 00:30:00' interval(10m)
|
||||
|
||||
#todo add test case while column filter exists for twa query
|
||||
|
||||
|
@ -536,7 +536,7 @@ if $data14 != 2 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select _wstart, stddev(k), stddev(b), stddev(c), tbname,a from m1 partition by tbname, a interval(10s) order by tbname
|
||||
sql select _wstart, stddev(k), stddev(b), stddev(c), tbname,a from m1 partition by tbname, a interval(10s) order by tbname
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -77,7 +77,7 @@ $ts1 = $tb1 . .ts
|
|||
$ts2 = $tb2 . .ts
|
||||
|
||||
print ===============================groupby_operation
|
||||
print
|
||||
print
|
||||
print ==== select count(*), c1 from group_tb0 group by c1
|
||||
sql select count(*), c1 from group_tb0 group by c1
|
||||
print rows: $rows
|
||||
|
@ -142,7 +142,7 @@ print $data20 $data21 $data22 $data23
|
|||
print $data80 $data81 $data82 $data83
|
||||
print $data90 $data91 $data92 $data93
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
sql select sum(c1), c1, avg(c1), min(c1), max(c2) from group_tb0 where c1 < 20 group by c1;
|
||||
if $row != 20 then
|
||||
|
@ -581,10 +581,10 @@ endi
|
|||
sql create table st (ts timestamp, c int) tags (t1 int, t2 int, t3 int, t4 int);
|
||||
sql create table t1 using st tags(1, 1, 1, 1);
|
||||
sql create table t2 using st tags(1, 2, 2, 2);
|
||||
sql insert into t1 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
|
||||
sql insert into t1 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
|
||||
sql insert into t2 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
|
||||
sql insert into t2 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
|
||||
sql insert into t1 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
|
||||
sql insert into t1 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
|
||||
sql insert into t2 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
|
||||
sql insert into t2 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
|
||||
|
||||
print =================>TD-2665
|
||||
sql_error create table txx as select avg(c) as t from st;
|
||||
|
|
|
@ -565,10 +565,10 @@ endi
|
|||
sql create table st (ts timestamp, c int) tags (t1 int, t2 int, t3 int, t4 int);
|
||||
sql create table t1 using st tags(1, 1, 1, 1);
|
||||
sql create table t2 using st tags(1, 2, 2, 2);
|
||||
sql insert into t1 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
|
||||
sql insert into t1 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
|
||||
sql insert into t2 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
|
||||
sql insert into t2 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
|
||||
sql insert into t1 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
|
||||
sql insert into t1 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
|
||||
sql insert into t2 values ('2020-03-27 04:11:16.000', 1)('2020-03-27 04:11:17.000', 2) ('2020-03-27 04:11:18.000', 3) ('2020-03-27 04:11:19.000', 4) ;
|
||||
sql insert into t2 values ('2020-03-27 04:21:16.000', 1)('2020-03-27 04:31:17.000', 2) ('2020-03-27 04:51:18.000', 3) ('2020-03-27 05:10:19.000', 4) ;
|
||||
|
||||
print =================>TD-2665
|
||||
sql_error create table txx as select avg(c) as t from st;
|
||||
|
|
|
@ -16,7 +16,7 @@ sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
|
|||
sql create table tb2 using st2 tags (2,2.0,"2",2.0,2,2,"2");
|
||||
sql create table tb3 using st2 tags (3,3.0,"3",3.0,3,3,"3");
|
||||
sql create table tb4 using st2 tags (4,4.0,"4",4.0,4,4,"4");
|
||||
|
||||
|
||||
sql insert into tb1 values (now-200s,1,1.0,1.0,1,1,1,true ,"1","1")
|
||||
sql insert into tb1 values (now-150s,1,1.0,1.0,1,1,1,false,"1","1")
|
||||
sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true ,"2","2")
|
||||
|
@ -30,28 +30,28 @@ sql select count(*),f1 from st2 group by f1 having count(f1) > 0 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2 then
|
||||
if $data00 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2 then
|
||||
if $data10 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 2 then
|
||||
if $data20 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 3 then
|
||||
if $data21 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 2 then
|
||||
if $data30 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 4 then
|
||||
if $data31 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -59,28 +59,28 @@ sql select count(*),f1 from st2 group by f1 having count(*) > 0 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2 then
|
||||
if $data00 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2 then
|
||||
if $data10 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 2 then
|
||||
if $data20 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 3 then
|
||||
if $data21 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 2 then
|
||||
if $data30 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 4 then
|
||||
if $data31 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -88,28 +88,28 @@ sql select count(*),f1 from st2 group by f1 having count(f2) > 0 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2 then
|
||||
if $data00 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2 then
|
||||
if $data10 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 2 then
|
||||
if $data20 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 3 then
|
||||
if $data21 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 2 then
|
||||
if $data30 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 4 then
|
||||
if $data31 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -119,16 +119,16 @@ sql select last(f1) from st2 group by f1 having count(f2) > 0 order by f1;;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1 then
|
||||
if $data00 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2 then
|
||||
if $data10 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3 then
|
||||
if $data20 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4 then
|
||||
if $data30 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -140,16 +140,16 @@ sql select avg(f1),count(f1) from st2 group by f1 having avg(f1) > 2 order by f1
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
if $data00 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -157,16 +157,16 @@ sql select avg(f1),count(f1) from st2 group by f1 having avg(f1) > 2 and sum(f1)
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
if $data00 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -174,22 +174,22 @@ sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having avg(f1) > 2 and
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
if $data00 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 6 then
|
||||
if $data02 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 8 then
|
||||
if $data12 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -197,22 +197,22 @@ sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having avg(f1) > 2 ord
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
if $data00 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 6 then
|
||||
if $data02 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 8 then
|
||||
if $data12 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -220,40 +220,40 @@ sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having sum(f1) > 0 ord
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6 then
|
||||
if $data22 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -261,13 +261,13 @@ sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having sum(f1) > 2 and
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4 then
|
||||
if $data02 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -276,22 +276,22 @@ sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having 1 <= sum(f1) an
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -299,16 +299,16 @@ sql select avg(f1),count(f1),sum(f1),twa(f1),tbname from st2 group by tbname hav
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.500000000 then
|
||||
if $data00 != 2.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 8 then
|
||||
if $data01 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 20 then
|
||||
if $data02 != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != tb1 then
|
||||
if $data04 != tb1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -318,16 +318,16 @@ sql select avg(f1),count(f1),sum(f1),twa(f1),tbname from st2 group by tbname hav
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.500000000 then
|
||||
if $data00 != 2.500000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 8 then
|
||||
if $data01 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 20 then
|
||||
if $data02 != 20 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != tb1 then
|
||||
if $data04 != tb1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -337,40 +337,40 @@ sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having sum(f1) > 0 ord
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6 then
|
||||
if $data22 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -378,31 +378,31 @@ sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having sum(f1) > 3 ord
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4 then
|
||||
if $data02 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 4.000000000 then
|
||||
if $data20 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -411,119 +411,119 @@ sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having sum(f1) > 1 ord
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6 then
|
||||
if $data22 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having sum(f1) > 3 or sum(f1) > 1 order by f1;
|
||||
if $rows != 4 then
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6 then
|
||||
if $data22 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having sum(f1) > 3 or sum(f1) > 4 order by f1;
|
||||
if $rows != 3 then
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4 then
|
||||
if $data02 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 4.000000000 then
|
||||
if $data20 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
############or issue
|
||||
sql select avg(f1),count(f1),sum(f1) from st2 group by f1 having sum(f1) > 3 and avg(f1) > 4 order by f1;
|
||||
if $rows != 0 then
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -635,7 +635,7 @@ endi
|
|||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
|
@ -735,18 +735,18 @@ endi
|
|||
if $data23 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data33 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data33 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql_error select avg(f1),count(st2.*),sum(f1),stddev(f1) from st2 group by f1 having (LEASTSQUARES(f1) < 1);
|
||||
|
@ -777,27 +777,27 @@ if $data03 != 0.000000000 then
|
|||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 0.000000000 then
|
||||
return -1
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1),count(st2.*),sum(f1),stddev(f1) from st2 group by f1 having min(f1) > 2 order by f1;
|
||||
|
@ -818,16 +818,16 @@ if $data03 != 0.000000000 then
|
|||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1),count(st2.*),sum(f1),stddev(f1),min(f1) from st2 group by f1 having min(f1) > 2 order by f1;
|
||||
if $rows != 2 then
|
||||
|
@ -900,27 +900,27 @@ if $data14 != 4 then
|
|||
endi
|
||||
|
||||
sql select avg(f1),count(st2.*),sum(f1),stddev(f1),min(f1),max(f1) from st2 group by f1 having max(f1) != 2 order by f1;
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -928,7 +928,7 @@ if $data11 != 2 then
|
|||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
|
@ -946,7 +946,7 @@ if $data21 != 2 then
|
|||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 0.000000000 then
|
||||
return -1
|
||||
|
@ -990,7 +990,7 @@ if $data12 != 6 then
|
|||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
if $data14 != 3 then
|
||||
return -1
|
||||
|
@ -1013,9 +1013,9 @@ endi
|
|||
if $data24 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
@ -1080,12 +1080,12 @@ endi
|
|||
if $data24 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data26 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data26 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
@ -1121,18 +1121,18 @@ if $data30 != 4.000000000 then
|
|||
endi
|
||||
|
||||
sql select aPERCENTILE(f1,20) from st2 group by f1 having apercentile(f1,1) > 1 order by f1;
|
||||
if $rows != 3 then
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select aPERCENTILE(f1,20) from st2 group by f1 having apercentile(f1,1) > 1 and apercentile(f1,1) < 50 order by f1;
|
||||
if $rows != 3 then
|
||||
|
@ -1195,7 +1195,7 @@ if $data10 != 2.000000000 then
|
|||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -1204,7 +1204,7 @@ sql select avg(f1),spread(f2) from st2 group by f1 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0.000000000 then
|
||||
|
@ -1213,7 +1213,7 @@ endi
|
|||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0.000000000 then
|
||||
if $data11 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
|
@ -1222,7 +1222,7 @@ endi
|
|||
if $data21 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 0.000000000 then
|
||||
|
@ -1239,13 +1239,13 @@ endi
|
|||
if $data01 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0.000000000 then
|
||||
|
@ -1257,7 +1257,7 @@ endi
|
|||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 0.000000000 then
|
||||
|
@ -1283,9 +1283,9 @@ if $data33 != 0.000000000 then
|
|||
endi
|
||||
|
||||
sql select avg(f1), spread(f1), spread(f2), spread(st2.f1) from st2 group by f1 having spread(f1) != 0 order by f1;
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1), spread(f1), spread(f2), spread(st2.f1) from st2 group by f1 having spread(f1) + 1 > 0;
|
||||
|
||||
|
@ -1438,7 +1438,7 @@ if $data01 != 0.000000000 then
|
|||
endi
|
||||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -1529,7 +1529,7 @@ if $data13 != 0.000000000 then
|
|||
endi
|
||||
|
||||
sql select avg(f1), spread(f1), spread(f2), spread(st2.f1) from st2 where f2 > 2 group by f1 having avg(f1) > 0 order by f1;
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
|
@ -1558,7 +1558,7 @@ if $data13 != 0.000000000 then
|
|||
endi
|
||||
|
||||
sql select avg(f1), spread(f1), spread(f2), spread(st2.f1) from st2 where f3 > 2 group by f1 having avg(f1) > 0 order by f1;
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
|
@ -1624,7 +1624,7 @@ endi
|
|||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -1643,7 +1643,7 @@ endi
|
|||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -1660,7 +1660,7 @@ endi
|
|||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
|
|||
sql create table tb2 using st2 tags (2,2.0,"2",2.0,2,2,"2");
|
||||
sql create table tb3 using st2 tags (3,3.0,"3",3.0,3,3,"3");
|
||||
sql create table tb4 using st2 tags (4,4.0,"4",4.0,4,4,"4");
|
||||
|
||||
|
||||
sql insert into tb1 values (now-200s,1,1.0,1.0,1,1,1,true ,"1","1")
|
||||
sql insert into tb1 values (now-150s,1,1.0,1.0,1,1,1,false,"1","1")
|
||||
sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true ,"2","2")
|
||||
|
@ -30,28 +30,28 @@ sql select count(*),f1 from tb1 group by f1 having count(f1) > 0 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2 then
|
||||
if $data00 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2 then
|
||||
if $data10 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 2 then
|
||||
if $data20 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 3 then
|
||||
if $data21 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 2 then
|
||||
if $data30 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 4 then
|
||||
if $data31 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -59,28 +59,28 @@ sql select count(*),f1 from tb1 group by f1 having count(*) > 0 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2 then
|
||||
if $data00 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2 then
|
||||
if $data10 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 2 then
|
||||
if $data20 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 3 then
|
||||
if $data21 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 2 then
|
||||
if $data30 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 4 then
|
||||
if $data31 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -88,28 +88,28 @@ sql select count(*),f1 from tb1 group by f1 having count(f2) > 0 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2 then
|
||||
if $data00 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2 then
|
||||
if $data10 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 2 then
|
||||
if $data20 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 3 then
|
||||
if $data21 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 2 then
|
||||
if $data30 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 4 then
|
||||
if $data31 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -119,16 +119,16 @@ sql select last(f1) from tb1 group by f1 having count(f2) > 0 order by f1;;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1 then
|
||||
if $data00 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2 then
|
||||
if $data10 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3 then
|
||||
if $data20 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4 then
|
||||
if $data30 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -142,16 +142,16 @@ sql select avg(f1),count(f1) from tb1 group by f1 having avg(f1) > 2 order by f1
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
if $data00 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -159,16 +159,16 @@ sql select avg(f1),count(f1) from tb1 group by f1 having avg(f1) > 2 and sum(f1)
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
if $data00 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -176,22 +176,22 @@ sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having avg(f1) > 2 and
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
if $data00 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 6 then
|
||||
if $data02 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 8 then
|
||||
if $data12 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -199,22 +199,22 @@ sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having avg(f1) > 2 ord
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
if $data00 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 6 then
|
||||
if $data02 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 8 then
|
||||
if $data12 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -222,40 +222,40 @@ sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 0 ord
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6 then
|
||||
if $data22 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -263,13 +263,13 @@ sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 2 and
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4 then
|
||||
if $data02 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -278,22 +278,22 @@ sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having 1 <= sum(f1) an
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -309,40 +309,40 @@ sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 0 ord
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6 then
|
||||
if $data22 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -350,31 +350,31 @@ sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 ord
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4 then
|
||||
if $data02 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 4.000000000 then
|
||||
if $data20 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -383,119 +383,119 @@ sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 1 ord
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6 then
|
||||
if $data22 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 or sum(f1) > 1 order by f1;
|
||||
if $rows != 4 then
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 4 then
|
||||
if $data12 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 6 then
|
||||
if $data22 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 or sum(f1) > 4 order by f1;
|
||||
if $rows != 3 then
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 4 then
|
||||
if $data02 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 4.000000000 then
|
||||
if $data20 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
############or issue
|
||||
sql select avg(f1),count(f1),sum(f1) from tb1 group by f1 having sum(f1) > 3 and avg(f1) > 4 order by f1;
|
||||
if $rows != 0 then
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -607,7 +607,7 @@ endi
|
|||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
|
@ -707,18 +707,18 @@ endi
|
|||
if $data23 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data33 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data33 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having (LEASTSQUARES(f1) < 1);
|
||||
|
@ -749,27 +749,27 @@ if $data03 != 0.000000000 then
|
|||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 0.000000000 then
|
||||
return -1
|
||||
if $data21 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having min(f1) > 2 order by f1;
|
||||
|
@ -790,16 +790,16 @@ if $data03 != 0.000000000 then
|
|||
endi
|
||||
if $data10 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 8 then
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1) from tb1 group by f1 having min(f1) > 2 order by f1;
|
||||
if $rows != 2 then
|
||||
|
@ -872,27 +872,27 @@ if $data14 != 4 then
|
|||
endi
|
||||
|
||||
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1) from tb1 group by f1 having max(f1) != 2 order by f1;
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -900,7 +900,7 @@ if $data11 != 2 then
|
|||
return -1
|
||||
endi
|
||||
if $data12 != 6 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
|
@ -918,7 +918,7 @@ if $data21 != 2 then
|
|||
return -1
|
||||
endi
|
||||
if $data22 != 8 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 0.000000000 then
|
||||
return -1
|
||||
|
@ -962,7 +962,7 @@ if $data12 != 6 then
|
|||
return -1
|
||||
endi
|
||||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
if $data14 != 3 then
|
||||
return -1
|
||||
|
@ -985,9 +985,9 @@ endi
|
|||
if $data24 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
@ -1052,12 +1052,12 @@ endi
|
|||
if $data24 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data26 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data26 != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
@ -1099,18 +1099,18 @@ if $data30 != 4.000000000 then
|
|||
endi
|
||||
|
||||
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1 order by f1;
|
||||
if $rows != 3 then
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select aPERCENTILE(f1,20) from tb1 group by f1 having apercentile(f1,1) > 1 and apercentile(f1,1) < 50 order by f1;
|
||||
if $rows != 3 then
|
||||
|
@ -1173,7 +1173,7 @@ if $data10 != 2.000000000 then
|
|||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -1182,7 +1182,7 @@ sql select avg(f1),spread(f2) from tb1 group by f1 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1.000000000 then
|
||||
if $data00 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0.000000000 then
|
||||
|
@ -1191,7 +1191,7 @@ endi
|
|||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0.000000000 then
|
||||
if $data11 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
|
@ -1200,7 +1200,7 @@ endi
|
|||
if $data21 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != 4.000000000 then
|
||||
if $data30 != 4.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 0.000000000 then
|
||||
|
@ -1217,13 +1217,13 @@ endi
|
|||
if $data01 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 0.000000000 then
|
||||
|
@ -1235,7 +1235,7 @@ endi
|
|||
if $data13 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != 3.000000000 then
|
||||
if $data20 != 3.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 0.000000000 then
|
||||
|
@ -1261,9 +1261,9 @@ if $data33 != 0.000000000 then
|
|||
endi
|
||||
|
||||
sql select avg(f1), spread(f1), spread(f2), spread(tb1.f1) from tb1 group by f1 having spread(f1) != 0 order by f1;
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select avg(f1), spread(f1), spread(f2), spread(tb1.f1) from tb1 group by f1 having spread(f1) + 1 > 0;
|
||||
|
||||
|
@ -1416,7 +1416,7 @@ if $data01 != 0.000000000 then
|
|||
endi
|
||||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -1507,7 +1507,7 @@ if $data13 != 0.000000000 then
|
|||
endi
|
||||
|
||||
sql select avg(f1), spread(f1), spread(f2), spread(tb1.f1) from tb1 where f2 > 2 group by f1 having avg(f1) > 0 order by f1;
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
|
@ -1536,7 +1536,7 @@ if $data13 != 0.000000000 then
|
|||
endi
|
||||
|
||||
sql select avg(f1), spread(f1), spread(f2), spread(tb1.f1) from tb1 where f3 > 2 group by f1 having avg(f1) > 0 order by f1;
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 3.000000000 then
|
||||
|
@ -1602,7 +1602,7 @@ endi
|
|||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -1621,7 +1621,7 @@ endi
|
|||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -1638,7 +1638,7 @@ endi
|
|||
if $data02 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 0.000000000 then
|
||||
if $data03 != 0.000000000 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
sql create table tb (ts timestamp, c1 int, c2 timestamp)
|
||||
|
@ -78,4 +78,4 @@ if $data40 != @19-05-05 11:59:00.000@ then
|
|||
endi
|
||||
if $data50 != @19-05-05 12:00:00.000@ then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
|
|
@ -19,7 +19,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
|
||||
|
@ -31,9 +31,9 @@ $x = 0
|
|||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
$ts = $ts0 + $xs
|
||||
sql insert into $tb values ( $ts , $x )
|
||||
sql insert into $tb values ( $ts , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
$ts = $ts0 + $delta
|
||||
|
@ -42,9 +42,9 @@ sql import into $tb values ( $ts , -1)
|
|||
sql select count(*) from $tb
|
||||
$res = $rowNum + 1
|
||||
if $data00 != $res then
|
||||
print expected: $res
|
||||
print returned: $rows
|
||||
print expected: $res
|
||||
print returned: $rows
|
||||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -18,7 +18,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
|
||||
|
@ -30,9 +30,9 @@ $x = 0
|
|||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
$ts = $ts0 + $xs
|
||||
sql insert into $tb values ( $ts , $x )
|
||||
sql insert into $tb values ( $ts , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
$ts = $ts0 + $delta
|
||||
|
@ -41,9 +41,9 @@ sql import into $tb values ( $ts , -1)
|
|||
sql select count(*) from $tb
|
||||
$res = $rowNum + 1
|
||||
if $data00 != $res then
|
||||
print expected: $res
|
||||
print returned: $rows
|
||||
print expected: $res
|
||||
print returned: $rows
|
||||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -18,7 +18,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
sql reset query cache
|
||||
|
@ -30,9 +30,9 @@ $x = 0
|
|||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
$ts = $ts0 + $xs
|
||||
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x )
|
||||
sql insert into $tb values ( $ts , $x , $x , $x , $x , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
$ts = $ts + 1
|
||||
|
@ -46,9 +46,9 @@ sql show databases
|
|||
sql select count(*) from $tb
|
||||
$res = $rowNum + 2
|
||||
if $data00 != $res then
|
||||
print expected: $res
|
||||
print returned: $rows
|
||||
print expected: $res
|
||||
print returned: $rows
|
||||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -59,7 +59,7 @@ sql select * from $tb order by ts desc
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != $col1 then
|
||||
if $data01 != $col1 then
|
||||
return -1
|
||||
endi
|
||||
print data03 = $data03
|
||||
|
@ -213,7 +213,7 @@ if $data46 != @quoted double@ then
|
|||
endi
|
||||
|
||||
# case: support NULL char of the binary field [TBASE-660]
|
||||
sql create table NULLb (ts timestamp, c1 binary(20), c2 binary(20), c3 float)
|
||||
sql create table NULLb (ts timestamp, c1 binary(20), c2 binary(20), c3 float)
|
||||
sql insert into NULLb values ('2018-09-17 09:00:00.000', '', '', 3.746)
|
||||
sql select * from NULLb
|
||||
if $rows != 1 then
|
||||
|
@ -222,8 +222,8 @@ endi
|
|||
|
||||
#sql drop database $db
|
||||
#sql show databases
|
||||
#if $rows != 0 then
|
||||
#if $rows != 0 then
|
||||
# return -1
|
||||
#endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -18,7 +18,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
|
||||
|
@ -32,7 +32,7 @@ while $i < $halfNum
|
|||
$tb1 = $tbPrefix . $tbId
|
||||
sql create table $tb using $stb tags( $i )
|
||||
sql create table $tb1 using $stb tags( $tbId )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -46,10 +46,10 @@ while $i < $halfNum
|
|||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
sql create table ap1 (ts timestamp, pav float);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -55,7 +55,7 @@ while $i < $tbNum
|
|||
endw
|
||||
|
||||
$tstart = 100000
|
||||
$mt = $mtPrefix . 1
|
||||
$mt = $mtPrefix . 1
|
||||
sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(12), t3 int)
|
||||
|
||||
$i = 0
|
||||
|
@ -110,7 +110,7 @@ if $row != 3000 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
# TODO
|
||||
# TODO
|
||||
return
|
||||
|
||||
print ======= second tags join
|
||||
|
|
|
@ -24,7 +24,7 @@ sql create table tbb using st2 tags (5);
|
|||
sql create table tbc using st2 tags (5);
|
||||
sql create table tbd using st2 tags (5);
|
||||
sql create table tbe using st2 tags (5);
|
||||
|
||||
|
||||
sql insert into tb1 values ("2021-05-09 10:10:10", 1, 2.0, '3', -1000)
|
||||
sql insert into tb1 values ("2021-05-10 10:10:11", 4, 5.0, NULL, -2000)
|
||||
sql insert into tb1 values ("2021-05-12 10:10:12", 6,NULL, NULL, -3000)
|
||||
|
|
|
@ -9,7 +9,7 @@ sql select last(ts) from tb1
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
|
@ -18,7 +18,7 @@ sql select last(f1) from tb1
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 6 then
|
||||
if $data00 != 6 then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
|
@ -27,21 +27,21 @@ sql select last(*) from tb1
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 6 then
|
||||
if $data01 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 5.000000000 then
|
||||
if $data02 != 5.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 3 then
|
||||
if $data03 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -49,28 +49,28 @@ sql select last(tb1.*,ts,f4) from tb1
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 6 then
|
||||
if $data01 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 5.000000000 then
|
||||
if $data02 != 5.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 3 then
|
||||
if $data03 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != @21-05-12 10:10:12.000@ then
|
||||
if $data05 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data06 != @70-01-01 07:59:57.000@ then
|
||||
if $data06 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -79,7 +79,7 @@ sql select last(ts) from tb2
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-11 10:11:15.000@ then
|
||||
if $data00 != @21-05-11 10:11:15.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
|
@ -88,7 +88,7 @@ sql select last(f1) from tb2
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != -6 then
|
||||
if $data00 != -6 then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
|
@ -97,21 +97,21 @@ sql select last(*) from tb2
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-11 10:11:15.000@ then
|
||||
if $data00 != @21-05-11 10:11:15.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data01 != -6 then
|
||||
if $data01 != -6 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != -7.000000000 then
|
||||
if $data02 != -7.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != -8 then
|
||||
if $data03 != -8 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != @70-01-01 07:59:56.999@ then
|
||||
if $data04 != @70-01-01 07:59:56.999@ then
|
||||
if $data04 != @70-01-01 07:59:57.-01@ then
|
||||
return -1
|
||||
endi
|
||||
|
@ -121,30 +121,30 @@ sql select last(tb2.*,ts,f4) from tb2
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-11 10:11:15.000@ then
|
||||
if $data00 != @21-05-11 10:11:15.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data01 != -6 then
|
||||
if $data01 != -6 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != -7.000000000 then
|
||||
if $data02 != -7.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != -8 then
|
||||
if $data03 != -8 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != @70-01-01 07:59:56.999@ then
|
||||
if $data04 != @70-01-01 07:59:56.999@ then
|
||||
if $data04 != @70-01-01 07:59:57.-01@ then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data05 != @21-05-11 10:11:15.000@ then
|
||||
if $data05 != @21-05-11 10:11:15.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data06 != @70-01-01 07:59:56.999@ then
|
||||
if $data06 != @70-01-01 07:59:56.999@ then
|
||||
if $data04 != @70-01-01 07:59:57.-01@ then
|
||||
return -1
|
||||
endi
|
||||
|
@ -155,21 +155,21 @@ sql select last(*) from tbd
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-11 10:12:29.000@ then
|
||||
if $data00 != @21-05-11 10:12:29.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data01 != NULL then
|
||||
if $data01 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != NULL then
|
||||
if $data02 != NULL then
|
||||
print $data02
|
||||
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
|
||||
|
||||
|
@ -184,7 +184,7 @@ sql select last(ts) from st2
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
|
@ -193,7 +193,7 @@ sql select last(f1) from st2
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 6 then
|
||||
if $data00 != 6 then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
|
@ -202,21 +202,21 @@ sql select last(*) from st2
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 6 then
|
||||
if $data01 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 37.000000000 then
|
||||
if $data02 != 37.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 27 then
|
||||
if $data03 != 27 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -225,28 +225,28 @@ sql select last(st2.*,ts,f4) from st2
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 6 then
|
||||
if $data01 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 37.000000000 then
|
||||
if $data02 != 37.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 27 then
|
||||
if $data03 != 27 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != @21-05-12 10:10:12.000@ then
|
||||
if $data05 != @21-05-12 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data06 != @70-01-01 07:59:57.000@ then
|
||||
if $data06 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -260,99 +260,99 @@ print ===> $data40 $data41 $data42 $data43 $data44 $data45 $data46 $data47 $data
|
|||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
if $data00 != @21-05-12 10:10:12.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 6 then
|
||||
if $data01 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 5.000000000 then
|
||||
if $data02 != 5.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 21 then
|
||||
if $data03 != 21 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != @21-05-11 10:12:23.000@ then
|
||||
if $data10 != @21-05-11 10:12:23.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 22 then
|
||||
if $data11 != 22 then
|
||||
return -1
|
||||
endi
|
||||
if $data12 != 23.000000000 then
|
||||
if $data12 != 23.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data13 != -8 then
|
||||
if $data13 != -8 then
|
||||
return -1
|
||||
endi
|
||||
if $data14 != @70-01-01 07:59:58.-04@ then
|
||||
if $data14 != @70-01-01 07:59:58.-04@ then
|
||||
return -1
|
||||
endi
|
||||
if $data15 != 2 then
|
||||
if $data15 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data20 != @21-05-10 10:12:24.000@ then
|
||||
if $data20 != @21-05-10 10:12:24.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 24 then
|
||||
if $data21 != 24 then
|
||||
return -1
|
||||
endi
|
||||
if $data22 != 11.000000000 then
|
||||
print expect 11.000000000 actual: $data22
|
||||
return -1
|
||||
endi
|
||||
if $data23 != 25 then
|
||||
if $data23 != 25 then
|
||||
return -1
|
||||
endi
|
||||
if $data24 != @70-01-01 07:59:57.-04@ then =
|
||||
return -1
|
||||
endi
|
||||
if $data25 != 3 then
|
||||
if $data25 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data30 != @21-05-11 10:12:25.000@ then
|
||||
if $data30 != @21-05-11 10:12:25.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != 26 then
|
||||
if $data31 != 26 then
|
||||
return -1
|
||||
endi
|
||||
if $data32 != 17.000000000 then
|
||||
if $data32 != 17.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data33 != 27 then
|
||||
if $data33 != 27 then
|
||||
return -1
|
||||
endi
|
||||
if $data34 != @70-01-01 07:59:56.-04@ then
|
||||
if $data34 != @70-01-01 07:59:56.-04@ then
|
||||
return -1
|
||||
endi
|
||||
if $data35 != 4 then
|
||||
if $data35 != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != @21-05-11 10:12:29.000@ then
|
||||
if $data40 != @21-05-11 10:12:29.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != 36 then
|
||||
if $data41 != 36 then
|
||||
return -1
|
||||
endi
|
||||
if $data42 != 37.000000000 then
|
||||
if $data42 != 37.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data43 != 35 then
|
||||
if $data43 != 35 then
|
||||
return -1
|
||||
endi
|
||||
if $data44 != @70-01-01 07:59:56.-05@ then
|
||||
if $data44 != @70-01-01 07:59:56.-05@ then
|
||||
return -1
|
||||
endi
|
||||
if $data45 != 5 then
|
||||
if $data45 != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -367,21 +367,21 @@ sql select last(*) from tbn;
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @21-05-13 10:10:12.000@ then
|
||||
if $data00 != @21-05-13 10:10:12.000@ then
|
||||
print $data00
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 6 then
|
||||
if $data01 != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 5.000000000 then
|
||||
if $data02 != 5.000000000 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 3 then
|
||||
if $data03 != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
if $data04 != @70-01-01 07:59:57.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ sql use $db
|
|||
|
||||
sql create stable st2 (ts timestamp, f1 int, f2 float, f3 double, f4 bigint, f5 smallint, f6 tinyint, f7 bool, f8 binary(10), f9 nchar(10)) tags (id1 int, id2 float, id3 nchar(10), id4 double, id5 smallint, id6 bigint, id7 binary(10))
|
||||
sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
|
||||
|
||||
|
||||
sql insert into tb1 values (now-200s,1,1.0,1.0,1,1,1,true,"1","1")
|
||||
sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true,"2","2")
|
||||
sql insert into tb1 values (now,3,3.0,3.0,3,3,3,true,"3","3")
|
||||
|
@ -24,32 +24,32 @@ sql select f1, last(*) from st2 group by f1 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1 then
|
||||
if $data00 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data02 != 1 then
|
||||
if $data02 != 1 then
|
||||
print $data02
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 1.00000 then
|
||||
if $data03 != 1.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 1.000000000 then
|
||||
if $data04 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1 then
|
||||
if $data05 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 1 then
|
||||
if $data06 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 1 then
|
||||
if $data07 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != 1 then
|
||||
if $data08 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data09 != 1 then
|
||||
if $data09 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -57,31 +57,31 @@ sql select f1, last(f1,st2.*) from st2 group by f1 order by f1;
|
|||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 1 then
|
||||
if $data00 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 1 then
|
||||
if $data03 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 1.00000 then
|
||||
if $data04 != 1.00000 then
|
||||
return -1
|
||||
endi
|
||||
if $data05 != 1.000000000 then
|
||||
if $data05 != 1.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 1 then
|
||||
if $data06 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data07 != 1 then
|
||||
if $data07 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data08 != 1 then
|
||||
if $data08 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data09 != 1 then
|
||||
if $data09 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ while $i > 0
|
|||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
$i = $i - 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$ts = $ts0
|
||||
$i = 1
|
||||
|
@ -36,7 +36,7 @@ while $i <= $tbNum
|
|||
$tb = $tbPrefix . $i
|
||||
while $x < $rowNum
|
||||
$ts = $ts + $delta
|
||||
$c6 = $x / 128
|
||||
$c6 = $x / 128
|
||||
$c6 = $c6 * 128
|
||||
$c6 = $x - $c6
|
||||
$c3 = NULL
|
||||
|
@ -46,9 +46,9 @@ while $i <= $tbNum
|
|||
if $xr = 0 then
|
||||
$c3 = $x
|
||||
endi
|
||||
sql insert into $tb values ( $ts , $x , NULL , $x , $x , $x , $c6 , true, 'BINARY', 'NCHAR' )
|
||||
sql insert into $tb values ( $ts , $x , NULL , $x , $x , $x , $c6 , true, 'BINARY', 'NCHAR' )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
||||
|
|
|
@ -27,20 +27,20 @@ if $data00 != @18-09-25 09:00:00.000@ then
|
|||
return -1
|
||||
endi
|
||||
if $data01 != 1439 then
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
if $data02 != NULL then
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
if $data03 != 1439.00000 then
|
||||
return -1
|
||||
endi
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 1439.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data06 != 31 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data07 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -110,7 +110,7 @@ if $rows != 1 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1d) fill(NULL) slimit 1
|
||||
sql select count(*),tbname,t1,t1,tbname from lr_stb0 where ts>'2018-09-24 00:00:00.000' and ts<'2018-09-25 00:00:00.000' partition by tbname, t1 interval(1d) fill(NULL) slimit 1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -21,12 +21,12 @@ sql insert into $table1 values(now-1m, "tablexname")
|
|||
sql insert into $table1 values(now-2m, "tablexxx")
|
||||
sql insert into $table1 values(now-2m, "table")
|
||||
|
||||
sql select b from $table1
|
||||
sql select b from $table1
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select b from $table1 where b like 'table_name'
|
||||
sql select b from $table1 where b like 'table_name'
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -37,17 +37,17 @@ if $rows != 1 then
|
|||
endi
|
||||
|
||||
sql show tables;
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show tables like 'table_name'
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql show tables like 'table\_name'
|
||||
if $rows != 1 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
|
||||
|
@ -32,7 +32,7 @@ while $i < $halfNum
|
|||
$tb1 = $tbPrefix . $tbId
|
||||
sql create table $tb using $stb tags( $i )
|
||||
sql create table $tb1 using $stb tags( $tbId )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -51,10 +51,10 @@ while $i < $halfNum
|
|||
$ts = $ts + $halfNum
|
||||
sql insert into $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
run tsim/parser/limit_tb.sim
|
||||
|
@ -73,4 +73,4 @@ sql use $db
|
|||
sql select * from (select ts, top(c1, 5) from $tb where ts >= $ts0 order by ts desc limit 3 offset 1)
|
||||
sql select * from (select ts, top(c1, 5) from $stb where ts >= $ts0 order by ts desc limit 3 offset 1)
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -32,7 +32,7 @@ while $i < $halfNum
|
|||
$tb1 = $tbPrefix . $tbId
|
||||
sql create table $tb using $stb tags( $i )
|
||||
sql create table $tb1 using $stb tags( $tbId )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -46,10 +46,10 @@ while $i < $halfNum
|
|||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
run tsim/parser/limit1_tb.sim
|
||||
|
|
|
@ -134,7 +134,7 @@ if $rows != 0 then
|
|||
endi
|
||||
|
||||
$offset = $offset - 1
|
||||
sql select * from $stb limit $limit offset $offset
|
||||
sql select * from $stb limit $limit offset $offset
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -308,7 +308,7 @@ if $data06 != binary5 then
|
|||
return -1
|
||||
endi
|
||||
if $data07 != nchar5 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
|
||||
$limit = $totalNum
|
||||
|
@ -491,4 +491,4 @@ endi
|
|||
sql select max(c1), min(c2), avg(c3), sum(c5), spread(c6), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu and t1 > 1 and t1 < 8 and c1 > 0 and c2 < 9 and c3 > 4 and c4 < 7 and c5 > 4 partition by t1 interval(5m) limit 2 offset 0
|
||||
if $rows != 6 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
|
|
@ -229,7 +229,7 @@ sql select sum(c1), avg(c2), stddev(c3), max(c4), min(c5), count(c6), first(c7),
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
$val = 45 * $rowNum
|
||||
$val = 45 * $rowNum
|
||||
$val = $val / 10
|
||||
if $data00 != $val then
|
||||
return -1
|
||||
|
@ -479,7 +479,7 @@ endi
|
|||
|
||||
### aggregation + limit offset (with interval)
|
||||
sql select max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) limit 5
|
||||
if $rows != 5 then
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -693,7 +693,7 @@ if $data11 != 3 then
|
|||
endi
|
||||
if $data21 != 3 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data31 != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -805,7 +805,7 @@ if $data02 != 3 then
|
|||
endi
|
||||
if $data03 != 5 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data04 != 3.00000 then
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -22,7 +22,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int, t2 nchar(20), t3 binary(20), t4 bigint, t5 smallint, t6 double)
|
||||
|
@ -40,7 +40,7 @@ while $i < $halfNum
|
|||
$tgstr1 = $tgstr1 . '
|
||||
sql create table $tb using $stb tags( $i , $tgstr , $tgstr , $i , $i , $i )
|
||||
sql create table $tb1 using $stb tags( $i1 , $tgstr1 , $tgstr1 , $i , $i , $i )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -52,13 +52,13 @@ while $i < $halfNum
|
|||
$binary = $binary . '
|
||||
$nchar = 'nchar . $c
|
||||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
run tsim/parser/limit2_query.sim
|
||||
|
|
|
@ -286,7 +286,7 @@ if $rows != $limit then
|
|||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
$limit = $rowNum
|
||||
$offset = $limit / 2
|
||||
$offset = $offset + 10
|
||||
|
@ -391,7 +391,7 @@ $offset = $offset - 2
|
|||
sql select max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2) group by t1 order by t1 limit $limit offset $offset
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data00 != @18-11-25 19:30:00.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -354,7 +354,7 @@ if $data06 != binary9 then
|
|||
return -1
|
||||
endi
|
||||
if $data07 != nchar0 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
|
||||
#sql select max(c1), min(c2), avg(c3), sum(c5), spread(c6), first(c7), last(c8), first(c9) from lm_stb0 where ts >= '2018-09-17 09:00:00.000' and ts <= '2018-09-17 10:30:00.000' and c1 > 1 and c2 < 9 and c3 > 2 and c4 < 8 and c5 > 3 and c6 < 7 and c7 > 0 and c8 like '%5' and t1 > 3 and t1 < 6 limit 1 offset 0;
|
||||
|
@ -387,7 +387,7 @@ if $data06 != binary5 then
|
|||
return -1
|
||||
endi
|
||||
if $data07 != nchar5 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select c1, tbname, t1 from lm_stb0 where ts >= '2018-09-17 09:00:00.000' and ts <= '2018-09-17 10:30:00.000' and c1 > 1 and c2 < 9 and c3 > 2 and c4 < 8 and c5 > 3 and c6 < 7 and c7 = 'true' and c8 like '%5' and t1 > 3 and t1 < 6;
|
||||
|
|
|
@ -218,7 +218,7 @@ sql select sum(c1), avg(c2), stddev(c3), max(c4), min(c5), count(c6), first(c7),
|
|||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
$val = 45 * $rowNum
|
||||
$val = 45 * $rowNum
|
||||
$val = $val / 10
|
||||
print $data05
|
||||
print $rowNum
|
||||
|
@ -464,7 +464,7 @@ endi
|
|||
|
||||
### aggregation + limit offset (with interval)
|
||||
sql select max(c1), max(c2), max(c3), max(c4), max(c5), max(c6) from $tb where ts >= $ts0 and ts <= $tsu interval(5m) limit 5
|
||||
if $rows != 5 then
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -684,7 +684,7 @@ if $data11 != 3 then
|
|||
endi
|
||||
if $data21 != 3 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql select twa(c1), twa(c2), twa(c3), twa(c4), twa(c5), twa(c6) from $tb where ts >= $ts0 and ts <= $tsu limit 3 offset 1
|
||||
if $rows != 0 then
|
||||
|
@ -789,7 +789,7 @@ if $data02 != 3 then
|
|||
endi
|
||||
if $data03 != 5 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
if $data04 != 3.00000 then
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -45,10 +45,10 @@ while $x < $rowNum
|
|||
$nchar = 'nchar . $c
|
||||
$nchar = $nchar . '
|
||||
$c = 0 - $x
|
||||
sql insert into $tb1 values ( $ts , $x , $x , $x , $x , true, $binary , $nchar )
|
||||
sql insert into $tb2 values ( $ts , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb1 values ( $ts , $x , $x , $x , $x , true, $binary , $nchar )
|
||||
sql insert into $tb2 values ( $ts , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
sql show databases
|
||||
|
||||
|
@ -69,10 +69,10 @@ while $x < $rowNum
|
|||
$nchar = 'nchar . $c
|
||||
$nchar = $nchar . '
|
||||
$c = 0 - $x
|
||||
sql insert into $tb1 values ( $ts , $x , $x , $x , $x , true, $binary , $nchar )
|
||||
sql insert into $tb2 values ( $ts , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb1 values ( $ts , $x , $x , $x , $x , true, $binary , $nchar )
|
||||
sql insert into $tb2 values ( $ts , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
#### query a STable and using where clause to filter out all the data from tb2 and make the query only return first/last of tb1
|
||||
sql select first(ts,c1), last(ts,c1), spread(c1), t1 from $stb where c1 > 0 group by t1
|
||||
|
@ -154,4 +154,4 @@ print ================== server restart completed
|
|||
sql select ts from m1 where ts='2020-1-1 1:5:1'
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
|
|
@ -32,14 +32,14 @@ sql_error create table $mt (ts timestamp, nchar int)
|
|||
sql_error create table $mt (ts timestamp, col int) tags (nchar int)
|
||||
sql create table $mt (ts timestamp, col nchar(60)) tags (tg nchar(60))
|
||||
sql show stables
|
||||
if $rows != 1 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != $mt then
|
||||
return -1
|
||||
endi
|
||||
sql describe $mt
|
||||
if $rows != 3 then
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != NCHAR then
|
||||
|
@ -128,7 +128,7 @@ print returned: $data01
|
|||
$quote = "
|
||||
$ret1 = $quote . $data01
|
||||
$ret2 = $ret1 . $quote
|
||||
print $ret2
|
||||
print $ret2
|
||||
if $ret2 = "NCHAR" then
|
||||
goto label2
|
||||
else
|
||||
|
@ -140,7 +140,7 @@ sql insert into $tb values (now+7s, "涛思" )
|
|||
sql select * from $tb order by ts desc
|
||||
print expected: 涛思
|
||||
print returned: $data01
|
||||
if $data01 != 涛思 then
|
||||
if $data01 != 涛思 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -157,26 +157,26 @@ sql create table $mt (ts timestamp, tbcol nchar(10), tbcol1 int) TAGS(tgcol ncha
|
|||
$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 , '0', $x )
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , '0', $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 , '1', $x )
|
||||
$ms = $x . m
|
||||
sql insert into $tb values (now + $ms , '1', $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
# case5: query_with_tag_filtering
|
||||
print ========== nchar.sim case5: query test
|
||||
|
@ -205,7 +205,7 @@ endi
|
|||
|
||||
# cumulative query with nchar tag filtering
|
||||
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tgcol = '1'
|
||||
if $rows != 1 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol
|
||||
|
@ -225,15 +225,15 @@ if $data10 != 5 then
|
|||
return -1
|
||||
endi
|
||||
sql_error select avg(tbcol) from $mt where tbcol1 = 1 group by tgcol
|
||||
sql_error select sum(tbcol) from $mt where tbcol1 = 1 group by tgcol
|
||||
sql_error select min(tbcol) from $mt where tbcol1 = 1 group by tgcol
|
||||
sql_error select max(tbcol) from $mt where tbcol1 = 1 group by tgcol
|
||||
sql_error select sum(tbcol) from $mt where tbcol1 = 1 group by tgcol
|
||||
sql_error select min(tbcol) from $mt where tbcol1 = 1 group by tgcol
|
||||
sql_error select max(tbcol) from $mt where tbcol1 = 1 group by tgcol
|
||||
|
||||
sql select first(tbcol), tgcol from $mt where tbcol1 = 1 group by tgcol order by tgcol
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 0 then
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -250,7 +250,7 @@ sql select last(tbcol), tgcol from $mt where tbcol1 = 1 group by tgcol order by
|
|||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 0 then
|
||||
if $data00 != 0 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 0 then
|
||||
|
@ -262,7 +262,7 @@ endi
|
|||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql create table stbb (ts timestamp, c1 nchar(5)) tags (t1 int)
|
||||
sql create table tbb1 using stbb tags(1)
|
||||
sql insert into tbb1 values ('2018-09-17 09:00:00', '涛思')
|
||||
|
@ -290,24 +290,24 @@ endi
|
|||
# if $rows != 100 then
|
||||
# return -1
|
||||
# endi
|
||||
#
|
||||
#
|
||||
# sql select * from $mt where ts > now + 4m and tbcol = '1'
|
||||
# if $rows != 75 then
|
||||
# return -1
|
||||
# endi
|
||||
#
|
||||
#
|
||||
# sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' group by tgcol
|
||||
#
|
||||
# sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = '1' group by tgcol
|
||||
#
|
||||
#
|
||||
# sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = '1' group by tgcol
|
||||
#
|
||||
# sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1' interval(1d) group by tgcol
|
||||
#
|
||||
# case: query_with_wildcard
|
||||
# case: query_with_wildcard
|
||||
# print =============== clear
|
||||
# sql drop database $db
|
||||
# sql show databases
|
||||
# if $rows != 0 then
|
||||
# if $rows != 0 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -218,7 +218,7 @@ if $data00 != 0.016666667 then
|
|||
endi
|
||||
|
||||
sql select derivative(c1, 1s, 0) from (select * from nest_tb0);
|
||||
print $rows $data00 $data10
|
||||
print $rows $data00 $data10
|
||||
if $rows != 9999 then
|
||||
return -1
|
||||
endi
|
||||
|
|
|
@ -433,7 +433,7 @@ endi
|
|||
|
||||
sql alter table st41 set tag tag_double = ''
|
||||
sql alter table st41 set tag tag_double = 'abc'
|
||||
sql alter table st41 set tag tag_double = '123abc'
|
||||
sql alter table st41 set tag tag_double = '123abc'
|
||||
sql_error alter table st41 set tag tag_double = abc
|
||||
|
||||
################### bigint smallint tinyint
|
||||
|
@ -501,7 +501,7 @@ sql_error alter table st51 set tag tag_tinyint = 'NULL'
|
|||
sql alter table st51 set tag tag_tinyint = ''
|
||||
sql_error alter table st51 set tag tag_tinyint = abc379
|
||||
|
||||
# test end
|
||||
# test end
|
||||
#sql drop database $db
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -9,7 +9,7 @@ $mtPrefix = m_di_mt
|
|||
$ntPrefix = m_di_nt
|
||||
$tbNum = 2
|
||||
$rowNum = 200
|
||||
$futureTs = 300000000000
|
||||
$futureTs = 300000000000
|
||||
|
||||
print =============== step1: create database and tables and insert data
|
||||
$i = 0
|
||||
|
@ -32,20 +32,20 @@ while $i < $tbNum
|
|||
while $x < $rowNum
|
||||
$cc = $futureTs + $x * 100 + 43
|
||||
$ns = $cc . b
|
||||
sql insert into $tb values (now + $ns , $x )
|
||||
sql insert into $tb values (now + $ns , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
sql create table $nt (ts timestamp, tbcol int)
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$cc = $futureTs + $x * 100 + 43
|
||||
$ns = $cc . b
|
||||
sql insert into $nt values (now + $ns , $x )
|
||||
$x = $x + 1
|
||||
sql insert into $nt values (now + $ns , $x )
|
||||
$x = $x + 1
|
||||
endw
|
||||
|
||||
print =============== step2: select count(*) from tables
|
||||
|
@ -83,7 +83,7 @@ print =============== step3: check nano second timestamp
|
|||
$i = 0
|
||||
$mt = $mtPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
sql insert into $tb values (now-43b , $x )
|
||||
sql insert into $tb values (now-43b , $x )
|
||||
sql select count(*) from $tb where ts<now
|
||||
if $data00 != 1 then
|
||||
print expected 1, actual: $data00
|
||||
|
@ -101,7 +101,7 @@ sql select count(*) from $mt interval(100000000b) sliding(100000000b)
|
|||
print =============== clear
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ endi
|
|||
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql select c1b from $st_name where c1b nmatch 'engine' order by ts
|
||||
if $data00 != @this is app egnine@ then
|
||||
|
@ -72,13 +72,13 @@ if $data00 != @this is app egnine@ then
|
|||
endi
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
endi
|
||||
|
||||
sql_error select c1b from $st_name where c1b match e;
|
||||
sql_error select c1b from $st_name where c1b nmatch e;
|
||||
|
||||
sql create table wrong_type(ts timestamp, c0 tinyint, c1 smallint, c2 int, c3 bigint, c4 float, c5 double, c6 bool, c7 nchar(20)) tags(t0 tinyint, t1 smallint, t2 int, t3 bigint, t4 float, t5 double, t6 bool, t7 nchar(10))
|
||||
sql insert into wrong_type_1 using wrong_type tags(1, 2, 3, 4, 5, 6, true, 'notsupport') values(now, 1, 2, 3, 4, 5, 6, false, 'notsupport')
|
||||
sql insert into wrong_type_1 using wrong_type tags(1, 2, 3, 4, 5, 6, true, 'notsupport') values(now, 1, 2, 3, 4, 5, 6, false, 'notsupport')
|
||||
sql_error select * from wrong_type where ts match '.*'
|
||||
sql_error select * from wrong_type where ts nmatch '.*'
|
||||
sql_error select * from wrong_type where c0 match '.*'
|
||||
|
|
|
@ -20,7 +20,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
|
||||
|
@ -34,7 +34,7 @@ while $i < $halfNum
|
|||
$tb1 = $tbPrefix . $tbId
|
||||
sql create table $tb using $stb tags( $i )
|
||||
sql create table $tb1 using $stb tags( $tbId )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -48,10 +48,10 @@ while $i < $halfNum
|
|||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
sql use $db
|
||||
|
@ -67,43 +67,43 @@ while $loop <= $loops
|
|||
print loop: $loop
|
||||
endi
|
||||
while $i < 10
|
||||
sql select ts from $stb where t1 = $i
|
||||
sql select ts from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c1 from $stb where t1 = $i
|
||||
sql select c1 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c2 from $stb where t1 = $i
|
||||
sql select c2 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c3 from $stb where t1 = $i
|
||||
sql select c3 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c4 from $stb where t1 = $i
|
||||
sql select c4 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c5 from $stb where t1 = $i
|
||||
sql select c5 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c6 from $stb where t1 = $i
|
||||
sql select c6 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c7 from $stb where t1 = $i
|
||||
sql select c7 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c8 from $stb where t1 = $i
|
||||
sql select c8 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c9 from $stb where t1 = $i
|
||||
sql select c9 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
|
@ -130,44 +130,44 @@ while $loop <= $loops
|
|||
print loop: $loop
|
||||
endi
|
||||
while $i < 10
|
||||
sql select ts from $stb where t1 = $i
|
||||
sql select ts from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c1 from $stb where t1 = $i
|
||||
sql select c1 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c2 from $stb where t1 = $i
|
||||
sql select c2 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c3 from $stb where t1 = $i
|
||||
sql select c3 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c4 from $stb where t1 = $i
|
||||
sql select c4 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c5 from $stb where t1 = $i
|
||||
sql select c5 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c6 from $stb where t1 = $i
|
||||
sql select c6 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c7 from $stb where t1 = $i
|
||||
sql select c7 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
sql select c8 from $stb where t1 = $i
|
||||
sql select c8 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
print expect $rowNum, actual: $rows
|
||||
return -1
|
||||
endi
|
||||
sql select c9 from $stb where t1 = $i
|
||||
sql select c9 from $stb where t1 = $i
|
||||
if $rows != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
|
@ -176,4 +176,4 @@ while $loop <= $loops
|
|||
$loop = $loop + 1
|
||||
endw
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -27,7 +27,7 @@ $ts = $ts0
|
|||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
sql create table $tb using $stb tags( $i )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -39,12 +39,12 @@ while $i < $tbNum
|
|||
$binary = $binary . '
|
||||
$nchar = '涛思 . $c
|
||||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
##### select * from stb
|
||||
|
@ -54,7 +54,7 @@ if $rows != $totalNum then
|
|||
endi
|
||||
|
||||
##### select * from $stb with limit
|
||||
sql select * from $stb limit 1
|
||||
sql select * from $stb limit 1
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
@ -72,8 +72,8 @@ endi
|
|||
|
||||
sql drop database $db
|
||||
sql show 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
|
||||
|
|
|
@ -29,9 +29,9 @@ while $i < $tbNum
|
|||
sql create table $tb using $stb tags( $i , 0 )
|
||||
sql insert into $tb (ts, c1) values (now, 1);
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
print ====== table created
|
||||
print ====== table created
|
||||
|
||||
#### select distinct tag
|
||||
sql select distinct t1 from $stb
|
||||
|
@ -51,7 +51,7 @@ sql_error select distinct t1, t2 from &stb
|
|||
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -63,22 +63,22 @@ while $i < $tbNum
|
|||
endw
|
||||
|
||||
#======================= only check first table tag, TD-4827
|
||||
sql select count(*) from $mt where t1 in (0)
|
||||
if $rows != 1 then
|
||||
sql select count(*) from $mt where t1 in (0)
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != $rowNum then
|
||||
if $data00 != $rowNum then
|
||||
return -1;
|
||||
endi
|
||||
|
||||
$secTag = ' . abc
|
||||
$secTag = ' . abc
|
||||
$secTag = $secTag . 0
|
||||
$secTag = $secTag . '
|
||||
sql select count(*) from $mt where t2 =$secTag and t1 in (0)
|
||||
if $rows != 1 then
|
||||
sql select count(*) from $mt where t2 =$secTag and t1 in (0)
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != $rowNum then
|
||||
if $data00 != $rowNum then
|
||||
return -1;
|
||||
endi
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create $tbNum tables
|
||||
sql use $db
|
||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 binary(9), t2 binary(8))
|
||||
|
@ -37,7 +37,7 @@ while $i < $tbNum
|
|||
$tgstr1 = 'usr . $i1
|
||||
$tgstr1 = $tgstr1 . '
|
||||
sql create table $tb using $stb tags( $tgstr , $tgstr1 )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -49,12 +49,12 @@ while $i < $tbNum
|
|||
$binary = $binary . '
|
||||
$nchar = 'nchar . $c
|
||||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
print ====== tables created
|
||||
sql show tables
|
||||
|
@ -181,7 +181,7 @@ if $data04 != 涛思 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql alter table tb1_tg1 set tag t1 = NULL
|
||||
sql alter table tb1_tg1 set tag t1 = NULL
|
||||
sql alter table tb1_tg1 set tag t2 = NULL
|
||||
sql alter table tb1_tg1 set tag t3 = NULL
|
||||
sql alter table tb1_tg1 set tag t4 = NULL
|
||||
|
|
|
@ -36,7 +36,7 @@ while $i < $tbNum
|
|||
$t5 = $i
|
||||
$t6 = true
|
||||
sql create table $tb using $stb tags( $t1 , $t2 , $t3 , $t4 , $t5 , $t6 )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -44,13 +44,13 @@ while $i < $tbNum
|
|||
$c = $x / 10
|
||||
$c = $c * 10
|
||||
$c = $x - $c
|
||||
$binary = 'binary . $c
|
||||
$binary = 'binary . $c
|
||||
$binary = $binary . '
|
||||
$nchar = '涛思nchar . $c
|
||||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
$ts = $ts + $delta
|
||||
sql insert into $tb values ( $ts , NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL )
|
||||
$i = $i + 1
|
||||
|
@ -59,7 +59,7 @@ print ====== $db tables created
|
|||
|
||||
$db = $dbPrefix . 1
|
||||
sql drop database if exists $db
|
||||
sql create database $db maxrows 200
|
||||
sql create database $db maxrows 200
|
||||
sql use $db
|
||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 binary(15), t2 int, t3 bigint, t4 nchar(10), t5 double, t6 bool)
|
||||
|
||||
|
@ -67,7 +67,7 @@ $i = 0
|
|||
$ts = $ts0
|
||||
$halfNum = $tbNum / 2
|
||||
while $i < $tbNum
|
||||
$tb = $tbPrefix . $i
|
||||
$tb = $tbPrefix . $i
|
||||
$t1 = ' . $tb
|
||||
$t1 = $t1 . '
|
||||
$t2 = $i
|
||||
|
@ -77,18 +77,18 @@ while $i < $tbNum
|
|||
$t5 = $i
|
||||
$t6 = true
|
||||
sql create table $tb using $stb tags( $t1 , $t2 , $t3 , $t4 , $t5 , $t6 )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
$ts = $ts0 + $xs
|
||||
sql insert into $tb values ( $ts , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL )
|
||||
sql insert into $tb values ( $ts , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
$i = $i + 1
|
||||
endw
|
||||
print ====== $db tables created
|
||||
|
||||
|
||||
run tsim/parser/slimit_query.sim
|
||||
|
||||
print ================== restart server to commit data into disk
|
||||
|
@ -99,4 +99,4 @@ sql connect
|
|||
|
||||
run tsim/parser/slimit_query.sim
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -47,7 +47,7 @@ while $i < $tbNum
|
|||
endw
|
||||
|
||||
print ================== tables and data created
|
||||
|
||||
|
||||
run tsim/parser/slimit1_query.sim
|
||||
|
||||
print ================== restart server to commit data into disk
|
||||
|
@ -58,4 +58,4 @@ sql connect
|
|||
|
||||
run tsim/parser/slimit1_query.sim
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -97,10 +97,10 @@ if $data01 != 900 then
|
|||
return -1
|
||||
endi
|
||||
if $data11 != 900 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 1200 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select t2, count(*) from stb partition by t2 order by t2 desc slimit 2 soffset 0
|
||||
|
@ -120,10 +120,10 @@ if $data01 != 1200 then
|
|||
return -1
|
||||
endi
|
||||
if $data11 != 900 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
if $data21 != 900 then
|
||||
return -1
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from stb partition by t2 order by t2 asc slimit 2 soffset 1
|
||||
|
|
|
@ -75,7 +75,7 @@ $i = 0
|
|||
while $i < 10
|
||||
$tb = tb . $i
|
||||
$tg_added = ' . $tb
|
||||
$tg_added = $tg_added . '
|
||||
$tg_added = $tg_added . '
|
||||
sql alter table $tb set tag tg_added = $tg_added
|
||||
$i = $i + 1
|
||||
endw
|
||||
|
@ -148,4 +148,4 @@ if $rows != 3 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -135,7 +135,7 @@ sql select * from slm_stb0 where t2 >= 2 and t3 <= 9 partition by tbname slimit
|
|||
|
||||
##################################################
|
||||
# slm_db1 is a database that contains the exactly the same
|
||||
# schema as slm_db0, but all records in slm_db1 contains
|
||||
# schema as slm_db0, but all records in slm_db1 contains
|
||||
# only NULL values.
|
||||
$db = $dbPrefix . 1
|
||||
sql use $db
|
||||
|
@ -156,7 +156,7 @@ if $data00 != 0 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
sql select t1,t2,t3,t4,t5,t6,count(ts) from $stb partition by t1,t2,t3,t4,t5,t6
|
||||
sql select t1,t2,t3,t4,t5,t6,count(ts) from $stb partition by t1,t2,t3,t4,t5,t6
|
||||
if $rows != $tbNum then
|
||||
return -1
|
||||
endi
|
||||
|
@ -164,7 +164,7 @@ endi
|
|||
if $data(slm_tb1)[6] != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
if $data(slm_tb2)[6] != $rowNum then
|
||||
if $data(slm_tb2)[6] != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
if $data(slm_tb3)[0] != slm_tb3 then
|
||||
|
@ -193,7 +193,7 @@ endi
|
|||
if $data00 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
if $data90 != $rowNum then
|
||||
if $data90 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != slm_tb9 then
|
||||
|
|
|
@ -33,7 +33,7 @@ if $rows != 1 then
|
|||
return -1
|
||||
endi
|
||||
print data00 = $data00
|
||||
if $data00 != $stb then
|
||||
if $data00 != $stb then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -85,7 +85,7 @@ print create/alter/drop stable test passed
|
|||
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -96,4 +96,4 @@ sql create table tm0 using m1 tags('abcd', 'abcd');
|
|||
sql_error alter table tm0 set tag b = 'abcd1';
|
||||
sql_error alter table tm0 set tag a = 'abcd1';
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -73,7 +73,7 @@ sql select * from stb where t1 > 'a'
|
|||
print =====================> TD-2685
|
||||
sql_error select t1, count(t1) from stb;
|
||||
|
||||
## wildcard '%'
|
||||
## wildcard '%'
|
||||
#sql select * from stb where t1 like '%'
|
||||
#if $rows != 1 then
|
||||
# return -1
|
||||
|
@ -100,7 +100,7 @@ endi
|
|||
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 2 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -202,4 +202,4 @@ if $rows != 0 then
|
|||
return -1
|
||||
endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -22,7 +22,7 @@ $stb = $stbPrefix . $i
|
|||
|
||||
sql drop database $db -x step1
|
||||
step1:
|
||||
sql create database $db
|
||||
sql create database $db
|
||||
print ====== create tables
|
||||
sql use $db
|
||||
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int, t2 nchar(20), t3 binary(20), t4 bigint, t5 smallint, t6 double)
|
||||
|
@ -40,7 +40,7 @@ while $i < $halfNum
|
|||
$tgstr1 = $tgstr1 . '
|
||||
sql create table $tb using $stb tags( $i , $tgstr , $tgstr , $i , $i , $i )
|
||||
sql create table $tb1 using $stb tags( $i1 , $tgstr1 , $tgstr1 , $i , $i , $i )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -48,16 +48,16 @@ while $i < $halfNum
|
|||
$c = $x / 10
|
||||
$c = $c * 10
|
||||
$c = $x - $c
|
||||
$binary = 'binary . $c
|
||||
$binary = 'binary . $c
|
||||
$binary = $binary . '
|
||||
$nchar = 'nchar . $c
|
||||
$nchar = 'nchar . $c
|
||||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $c , $c , $c , $c , $c , $c , true, $binary , $nchar ) $tb1 values ( $ts , $c , NULL , $c , NULL , $c , $c , true, $binary , $nchar )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
|
||||
$i = $i + 1
|
||||
endw
|
||||
endw
|
||||
print ====== tables created
|
||||
|
||||
run tsim/parser/tbnameIn_query.sim
|
||||
|
@ -69,4 +69,4 @@ print ================== server restart completed
|
|||
|
||||
run tsim/parser/tbnameIn_query.sim
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -26,7 +26,7 @@ sql use $db
|
|||
sql select count(*) from $stb where tbname in ('ti_tb1', 'ti_tb300') and t1 > 2
|
||||
|
||||
# tbname in used on meter
|
||||
sql select count(*) from $tb where tbname in ('ti_tb1', 'ti_tb300')
|
||||
sql select count(*) from $tb where tbname in ('ti_tb1', 'ti_tb300')
|
||||
|
||||
## tbname in + group by tag
|
||||
print select count(*) from $stb where tbname in ('ti_tb1', 'ti_tb300') group by t1 order by t1 asc
|
||||
|
@ -305,7 +305,7 @@ sql select count(*), t1 from $stb where tbname in ('ti_tb1', 'ti_tb300') and tbn
|
|||
# return -1
|
||||
#endi
|
||||
#
|
||||
#
|
||||
#
|
||||
#$limit = $rowNum
|
||||
#$offset = $limit / 2
|
||||
#$offset = $offset + 10
|
||||
|
@ -410,7 +410,7 @@ sql select count(*), t1 from $stb where tbname in ('ti_tb1', 'ti_tb300') and tbn
|
|||
#sql select max(c1), min(c2), sum(c3), avg(c4), first(c7), last(c8), first(c9) from $stb where ts >= $ts0 and ts <= $tsu interval(5m) fill(value, -1, -2) group by t1 order by t1 limit $limit offset $offset
|
||||
#if $rows != $tbNum then
|
||||
# return -1
|
||||
#endi
|
||||
#endi
|
||||
#if $data00 != @18-11-25 19:30:00.000@ then
|
||||
# return -1
|
||||
#endi
|
||||
|
|
|
@ -30,7 +30,7 @@ while $i < $tbNum
|
|||
$t1 = ' . $tb
|
||||
$t1 = $t1 . '
|
||||
sql create table $tb using $stb tags( $t1 )
|
||||
|
||||
|
||||
$x = 0
|
||||
while $x < $rowNum
|
||||
$xs = $x * $delta
|
||||
|
@ -41,15 +41,15 @@ while $i < $tbNum
|
|||
$binary = binary . $c
|
||||
$nchar = '涛思nchar . $c
|
||||
$nchar = $nchar . '
|
||||
sql insert into $tb values ( $ts , $ts , $c )
|
||||
sql insert into $tb values ( $ts , $ts , $c )
|
||||
$x = $x + 1
|
||||
endw
|
||||
endw
|
||||
$ts = $ts + $delta
|
||||
sql insert into $tb values ( $ts , NULL, NULL )
|
||||
$i = $i + 1
|
||||
endw
|
||||
print ====== $db tables created
|
||||
|
||||
|
||||
run tsim/parser/timestamp_query.sim
|
||||
|
||||
print ================== restart server to commit data into disk
|
||||
|
|
|
@ -23,7 +23,7 @@ $tsu = $tsu + $ts0
|
|||
print ==================>issue #3481, normal column not allowed,
|
||||
sql select ts,c1,min(c2) from ts_stb0
|
||||
|
||||
print ==================>issue #4681, not equal operator on primary timestamp not allowed
|
||||
print ==================>issue #4681, not equal operator on primary timestamp not allowed
|
||||
sql select * from ts_stb0 where ts <> $ts0
|
||||
|
||||
##### select from supertable
|
||||
|
|
|
@ -13,7 +13,7 @@ sql use $db
|
|||
sql create stable st2 (ts timestamp, f1 int, f2 float, f3 double, f4 bigint, f5 smallint, f6 tinyint, f7 bool, f8 binary(10), f9 nchar(10)) tags (id1 int, id2 float, id3 nchar(10), id4 double, id5 smallint, id6 bigint, id7 binary(10))
|
||||
|
||||
sql create table tb1 using st2 tags (1,1.0,"1",1.0,1,1,"1");
|
||||
|
||||
|
||||
sql insert into tb1 values (now-200s,1,1.0,1.0,1,1,1,true,"1","1")
|
||||
sql insert into tb1 values (now-100s,2,2.0,2.0,2,2,2,true,"2","2")
|
||||
sql insert into tb1 values (now,3,3.0,3.0,3,3,3,true,"3","3")
|
||||
|
|
|
@ -17,7 +17,7 @@ $mt = $mtPrefix . $i
|
|||
|
||||
sql drop database if exists $db -x step1
|
||||
step1:
|
||||
sql create database if not exists $db
|
||||
sql create database if not exists $db
|
||||
sql use $db
|
||||
sql create table $mt (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int)
|
||||
|
||||
|
@ -169,7 +169,7 @@ sql create table wh_mt2_tb1 using wh_mt2 tags ('wh_mt2_tb1')
|
|||
# 2019-01-01 00:10:00.000 1546272600000
|
||||
# 2019-01-01 09:00:00.000 1546304400000
|
||||
# 2019-01-01 09:10:00.000 1546305000000
|
||||
sql insert into wh_mt2_tb1 values ('2019-01-01 00:00:00.000', '2019-01-01 09:00:00.000', 'binary10', 'nchar10')
|
||||
sql insert into wh_mt2_tb1 values ('2019-01-01 00:00:00.000', '2019-01-01 09:00:00.000', 'binary10', 'nchar10')
|
||||
sql insert into wh_mt2_tb1 values ('2019-01-01 00:10:00.000', '2019-01-01 09:10:00.000', 'binary10', 'nchar10')
|
||||
|
||||
sql select * from wh_mt2_tb1 where c1 > 1546304400000
|
||||
|
@ -309,7 +309,7 @@ endi
|
|||
|
||||
sql select * from wh_mt0 where c3 = 1;
|
||||
print $rows -> 1000
|
||||
print $data00 $data01 $data02
|
||||
print $data00 $data01 $data02
|
||||
if $row != 1000 then
|
||||
return -1
|
||||
endi
|
||||
|
|
Loading…
Reference in New Issue