提交 e5c633f8 编写于 作者: S Shengliang Guan

test: remove out date case

上级 93d38790
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
print ======== step1
sql create database d2
sql use d2
sql create table mt (ts timestamp, a int) TAGS (t int)
sql create table tb using mt tags (1)
sql insert into tb values(now-28d, -28)
sql insert into tb values(now-27d, -27)
sql insert into tb values(now-26d, -26)
sql select * from tb
if $rows != 3 then
return -1
endi
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != t then
return -1
endi
if $data21 != INT then
return -1
endi
print ======== step2
sql alter table mt add column b smallint
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != t then
return -1
endi
if $data31 != INT then
return -1
endi
print ======== step3
sql alter table mt add column c tinyint
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != t then
return -1
endi
if $data41 != INT then
return -1
endi
print ======== step4
sql alter table mt add column d int
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != t then
return -1
endi
if $data51 != INT then
return -1
endi
print ======== step5
sql alter table mt add column e bigint
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != t then
return -1
endi
if $data61 != INT then
return -1
endi
print ======== step6
sql alter table mt add column f float
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != t then
return -1
endi
if $data71 != INT then
return -1
endi
print ======== step7
sql alter table mt add column g double
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != t then
return -1
endi
if $data81 != INT then
return -1
endi
print ======== step8
sql alter table mt add column h binary(10)
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != h then
return -1
endi
if $data81 != BINARY then
return -1
endi
if $data82 != 10 then
return -1
endi
if $data90 != t then
return -1
endi
if $data91 != INT then
return -1
endi
print ======== step9
print ======== step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql use d2
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != h then
return -1
endi
if $data81 != BINARY then
return -1
endi
if $data82 != 10 then
return -1
endi
if $data90 != t then
return -1
endi
if $data91 != INT then
return -1
endi
print ======== step11
#sql alter table mt drop column a -x step111
# return -1
#step111:
#sql alter table mt drop column ts -x step112
# return -1
#step112:
#sql alter table mt drop column cdfg -x step113
# return -1
#step113:
#sql alter table mt add column a -x step114
# return -1
#step114:
#sql alter table mt add column b -x step115
# return -1
#step115:
print ======== step12
sql alter table mt drop column b
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != c then
return -1
endi
if $data21 != TINYINT then
return -1
endi
if $data30 != d then
return -1
endi
if $data31 != INT then
return -1
endi
if $data40 != e then
return -1
endi
if $data41 != BIGINT then
return -1
endi
if $data50 != f then
return -1
endi
if $data51 != FLOAT then
return -1
endi
if $data60 != g then
return -1
endi
if $data61 != DOUBLE then
return -1
endi
if $data70 != h then
return -1
endi
if $data71 != BINARY then
return -1
endi
if $data72 != 10 then
return -1
endi
if $data80 != t then
return -1
endi
if $data81 != INT then
return -1
endi
print ======== step13
sql alter table mt drop column c
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != d then
return -1
endi
if $data21 != INT then
return -1
endi
if $data30 != e then
return -1
endi
if $data31 != BIGINT then
return -1
endi
if $data40 != f then
return -1
endi
if $data41 != FLOAT then
return -1
endi
if $data50 != g then
return -1
endi
if $data51 != DOUBLE then
return -1
endi
if $data60 != h then
return -1
endi
if $data61 != BINARY then
return -1
endi
if $data62 != 10 then
return -1
endi
if $data70 != t then
return -1
endi
if $data71 != INT then
return -1
endi
print ======== step14
sql alter table mt drop column d
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != e then
return -1
endi
if $data21 != BIGINT then
return -1
endi
if $data30 != f then
return -1
endi
if $data31 != FLOAT then
return -1
endi
if $data40 != g then
return -1
endi
if $data41 != DOUBLE then
return -1
endi
if $data50 != h then
return -1
endi
if $data51 != BINARY then
return -1
endi
if $data52 != 10 then
return -1
endi
if $data60 != t then
return -1
endi
if $data61 != INT then
return -1
endi
print ======== step15
sql alter table mt drop column e
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != f then
return -1
endi
if $data21 != FLOAT then
return -1
endi
if $data30 != g then
return -1
endi
if $data31 != DOUBLE then
return -1
endi
if $data40 != h then
return -1
endi
if $data41 != BINARY then
return -1
endi
if $data42 != 10 then
return -1
endi
if $data50 != t then
return -1
endi
if $data51 != INT then
return -1
endi
print ======== step16
sql alter table mt drop column f
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != g then
return -1
endi
if $data21 != DOUBLE then
return -1
endi
if $data30 != h then
return -1
endi
if $data31 != BINARY then
return -1
endi
if $data32 != 10 then
return -1
endi
if $data40 != t then
return -1
endi
if $data41 != INT then
return -1
endi
print ======== step17
sql alter table mt drop column g
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != h then
return -1
endi
if $data21 != BINARY then
return -1
endi
if $data22 != 10 then
return -1
endi
if $data30 != t then
return -1
endi
if $data31 != INT then
return -1
endi
print ============= step18
sql alter table mt drop column h
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != t then
return -1
endi
if $data21 != INT then
return -1
endi
if $data30 != null then
return -1
endi
print ======= over
sql drop database d2
sql show databases
if $rows != 0 then
return -1
endi
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
print ======== step1
sql create database d1
sql use d1
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-28d, -28)
sql insert into tb values(now-27d, -27)
sql insert into tb values(now-26d, -26)
sql select * from tb
if $rows != 3 then
return -1
endi
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
print ======== step2
sql alter table tb add column b smallint
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
print ======== step3
sql alter table tb add column c tinyint
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
print ======== step4
sql alter table tb add column d int
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
print ======== step5
sql alter table tb add column e bigint
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
print ======== step6
sql alter table tb add column f float
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
print ======== step7
sql alter table tb add column g double
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
print ======== step8
sql alter table tb add column h binary(10)
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != h then
return -1
endi
if $data81 != BINARY then
return -1
endi
if $data82 != 10 then
return -1
endi
print ======== step9
print ======== step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql use d1
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != b then
return -1
endi
if $data21 != SMALLINT then
return -1
endi
if $data30 != c then
return -1
endi
if $data31 != TINYINT then
return -1
endi
if $data40 != d then
return -1
endi
if $data41 != INT then
return -1
endi
if $data50 != e then
return -1
endi
if $data51 != BIGINT then
return -1
endi
if $data60 != f then
return -1
endi
if $data61 != FLOAT then
return -1
endi
if $data70 != g then
return -1
endi
if $data71 != DOUBLE then
return -1
endi
if $data80 != h then
return -1
endi
if $data81 != BINARY then
return -1
endi
if $data82 != 10 then
return -1
endi
print ======== step11
sql alter table drop column a -x step111
return -1
step111:
sql alter table drop column ts -x step112
return -1
step112:
sql alter table drop column cdfg -x step113
return -1
step113:
sql alter table add column a -x step114
return -1
step114:
sql alter table add column b -x step115
return -1
step115:
print ======== step12
sql alter table tb drop column b
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != c then
return -1
endi
if $data21 != TINYINT then
return -1
endi
if $data30 != d then
return -1
endi
if $data31 != INT then
return -1
endi
if $data40 != e then
return -1
endi
if $data41 != BIGINT then
return -1
endi
if $data50 != f then
return -1
endi
if $data51 != FLOAT then
return -1
endi
if $data60 != g then
return -1
endi
if $data61 != DOUBLE then
return -1
endi
if $data70 != h then
return -1
endi
if $data71 != BINARY then
return -1
endi
if $data72 != 10 then
return -1
endi
print ======== step13
sql alter table tb drop column c
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != d then
return -1
endi
if $data21 != INT then
return -1
endi
if $data30 != e then
return -1
endi
if $data31 != BIGINT then
return -1
endi
if $data40 != f then
return -1
endi
if $data41 != FLOAT then
return -1
endi
if $data50 != g then
return -1
endi
if $data51 != DOUBLE then
return -1
endi
if $data60 != h then
return -1
endi
if $data61 != BINARY then
return -1
endi
if $data62 != 10 then
return -1
endi
print ======== step14
sql alter table tb drop column d
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != e then
return -1
endi
if $data21 != BIGINT then
return -1
endi
if $data30 != f then
return -1
endi
if $data31 != FLOAT then
return -1
endi
if $data40 != g then
return -1
endi
if $data41 != DOUBLE then
return -1
endi
if $data50 != h then
return -1
endi
if $data51 != BINARY then
return -1
endi
if $data52 != 10 then
return -1
endi
print ======== step15
sql alter table tb drop column e
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != f then
return -1
endi
if $data21 != FLOAT then
return -1
endi
if $data30 != g then
return -1
endi
if $data31 != DOUBLE then
return -1
endi
if $data40 != h then
return -1
endi
if $data41 != BINARY then
return -1
endi
if $data42 != 10 then
return -1
endi
print ======== step16
sql alter table tb drop column f
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != g then
return -1
endi
if $data21 != DOUBLE then
return -1
endi
if $data30 != h then
return -1
endi
if $data31 != BINARY then
return -1
endi
if $data32 != 10 then
return -1
endi
print ======== step17
sql alter table tb drop column g
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != h then
return -1
endi
if $data21 != BINARY then
return -1
endi
if $data22 != 10 then
return -1
endi
print ============= step18
sql alter table tb drop column h
sql describe tb
if $data00 != ts then
return -1
endi
if $data01 != TIMESTAMP then
return -1
endi
if $data10 != a then
return -1
endi
if $data11 != INT then
return -1
endi
if $data20 != null then
return -1
endi
print ======= over
sql drop database d1
sql show databases
if $rows != 0 then
return -1
endi
sql connect
sleep 2000
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_av_db
$tbPrefix = m_av_tb
$mtPrefix = m_av_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select avg(tbcol) from $tb
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
print =============== step3
sql select avg(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 2.000000000 then
return -1
endi
print =============== step4
sql select avg(tbcol) as b from $tb
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
print =============== step5
sql select avg(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data11 != 1.000000000 then
return -1
endi
sql select avg(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 9.500000000 then
return -1
endi
print =============== step6
sql select avg(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data41 != 4.000000000 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select avg(tbcol) from $mt
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
print =============== step8
sql select avg(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 2.000000000 then
return -1
endi
sql select avg(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
sql select avg(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 2.000000000 then
return -1
endi
print =============== step9
sql select avg(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1.000000000 then
return -1
endi
sql select avg(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 9.500000000 then
return -1
endi
print =============== step10
sql select avg(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 9.500000000 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select avg(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1.000000000 then
return -1
endi
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sql connect
sleep 2000
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_bo_db
$tbPrefix = m_bo_tb
$mtPrefix = m_bo_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select bottom(tbcol, 1) from $tb
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step3
sql select bottom(tbcol, 1) from $tb where ts > now + 4m
print ===> $data01
if $data01 != 5 then
return -1
endi
print =============== step4
sql select bottom(tbcol, 1) as b from $tb
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step5
sql select bottom(tbcol, 2) as b from $tb
print ===> $data01 $data11
if $data01 != 0 then
return -1
endi
if $data11 != 1 then
return -1
endi
print =============== step6
sql select bottom(tbcol, 2) as b from $tb where ts > now + 4m
print ===> $data01 $data11
if $data01 != 5 then
return -1
endi
if $data11 != 6 then
return -1
endi
sql select bottom(tbcol, 122) as b from $tb -x step6
return -1
step6:
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sql connect
sleep 2000
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_co_db
$tbPrefix = m_co_tb
$mtPrefix = m_co_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select count(*) from $tb
print ===> select count(*) from $tb => $data00
if $data00 != $rowNum then
return -1
endi
sql select count(tbcol) from $tb
print ===> $data00
if $data00 != $rowNum then
return -1
endi
print =============== step3
sql select count(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 5 then
return -1
endi
print =============== step4
sql select count(tbcol) as b from $tb
print ===> $data00
if $data00 != $rowNum then
return -1
endi
print =============== step5
sql select count(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
sql select count(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != $rowNum then
return -1
endi
print =============== step6
sql select count(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data01 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select count(*) from $mt
print ===> $data00
if $data00 != $totalNum then
return -1
endi
sql select count(tbcol) from $mt
print ===> $data00
if $data00 != $totalNum then
return -1
endi
print =============== step8
sql select count(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 50 then
return -1
endi
sql select count(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 100 then
return -1
endi
sql select count(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 25 then
return -1
endi
print =============== step9
sql select count(tbcol) as b from $mt interval(1m)
print ===> $data01
if $data01 != 10 then
return -1
endi
if $data11 != 10 then
return -1
endi
sql select count(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 200 then
return -1
endi
print =============== step10
sql select count(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != $rowNum then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select count(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data01
if $data01 != 1 then
return -1
endi
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_di_db
$tbPrefix = m_di_tb
$mtPrefix = m_di_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select diff(tbcol) from $tb
print ===> $data11
if $data11 != 1 then
return -1
endi
print =============== step3
sql select diff(tbcol) from $tb where ts > now + 4m
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select diff(tbcol) from $tb where ts < now + 4m
print ===> $data11
if $data11 != 1 then
return -1
endi
print =============== step4
sql select diff(tbcol) as b from $tb
print ===> $data11
if $data11 != 1 then
return -1
endi
print =============== step5
sql select diff(tbcol) as b from $tb interval(1m) -x step5
return -1
step5:
print =============== step6
sql select diff(tbcol) as b from $tb where ts < now + 4m interval(1m) -x step6
return -1
step6:
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_fi_db
$tbPrefix = m_fi_tb
$mtPrefix = m_fi_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select first(tbcol) from $tb
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step3
sql select first(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step4
sql select first(tbcol) as b from $tb
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step5
sql select first(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 0 then
return -1
endi
sql select first(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step6
sql select first(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data41 != 4 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select first(tbcol) from $mt
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step8
sql select first(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
sql select first(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 0 then
return -1
endi
sql select first(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step9
sql select first(tbcol) as b from $mt interval(1m)
print select first(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select first(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step10
sql select first(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 0 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select first(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
return -1
endi
print ===> $rows
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_in_db
$tbPrefix = m_in_tb
$mtPrefix = m_in_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb interval(1m)
print ===> $rows
if $rows < $rowNum then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data05 != 1 then
return -1
endi
print =============== step3
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now + 4m interval(1m)
print ===> $rows
if $rows > 10 then
return -1
endi
if $rows < 3 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data05 != 1 then
return -1
endi
print =============== step4
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now+40m and ts > now-1m interval(1m)
print ===> $rows
if $rows < 18 then
return -1
endi
if $rows > 22 then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data05 != 1 then
return -1
endi
print =============== step5
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $tb where ts < now+40m and ts > now+1m interval(1m) fill(value,0)
print ===> $rows
if $rows < 30 then
return -1
endi
if $rows > 50 then
return -1
endi
if $data21 != 1 then
return -1
endi
if $data25 != 1 then
return -1
endi
print =============== step6
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt interval(1m)
print ===> $rows
if $rows < 18 then
return -1
endi
if $rows > 22 then
return -1
endi
if $data11 > 15 then
return -1
endi
if $data11 < 5 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now + 4m interval(1m)
print ===> $rows
if $rows < 3 then
return -1
endi
if $rows > 7 then
return -1
endi
if $data11 > 15 then
return -1
endi
if $data11 < 5 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now+40m and ts > now-1m interval(1m)
print ===> $rows
if $rows < 18 then
return -1
endi
if $rows > 22 then
return -1
endi
if $data11 > 15 then
return -1
endi
if $data11 < 5 then
return -1
endi
print =============== step9
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from $mt where ts < now+40m and ts > now+1m interval(1m) fill(value, 0)
if $rows < 30 then
return -1
endi
if $rows > 50 then
return -1
endi
if $data11 > 15 then
return -1
endi
if $data11 < 5 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_la_db
$tbPrefix = m_la_tb
$mtPrefix = m_la_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select last(tbcol) from $tb
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step3
sql select last(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
print =============== step4
sql select last(tbcol) as b from $tb
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step5
sql select last(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select last(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step6
sql select last(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select last(tbcol) from $mt
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step8
sql select last(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
sql select last(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 19 then
return -1
endi
sql select last(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
print =============== step9
sql select last(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select last(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step10
sql select last(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 19 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select last(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
return -1
endi
print ===> $rows
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_le_db
$tbPrefix = m_le_tb
$mtPrefix = m_le_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db keep 36500
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 2
$ms = 1000
while $x < $rowNum
$ms = $ms + 1000
sql insert into $tb values ($ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select leastsquares(tbcol, 1, 1) from $tb
print ===> $data00
if $data00 != @{slop:1.000000, intercept:1.000000}@ then
return -1
endi
print =============== step3
sql select leastsquares(tbcol, 1, 1) from $tb where ts < now + 4m
print ===> $data00
if $data00 != @{slop:1.000000, intercept:1.000000}@ then
return -1
endi
print =============== step4
sql select leastsquares(tbcol, 1, 1) as b from $tb
print ===> $data00
if $data00 != @{slop:1.000000, intercept:1.000000}@ then
return -1
endi
print =============== step5
print select leastsquares(tbcol, 1, 1) as b from $tb interval(1d)
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1m)
print ===> $data01
if $data01 != @{slop:1.000000, intercept:1.000000}@ then
return -1
endi
print select leastsquares(tbcol, 1, 1) as b from $tb interval(1d)
sql select leastsquares(tbcol, 1, 1) as b from $tb interval(1d)
print ===> $data01
if $data01 != @{slop:1.000000, intercept:1.000000}@ then
return -1
endi
print =============== step6
sql select leastsquares(tbcol, 1, 1) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data01 != @{slop:1.000000, intercept:1.000000}@ then
return -1
endi
print ===> $rows
if $rows != 1 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_ma_db
$tbPrefix = m_ma_tb
$mtPrefix = m_ma_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select max(tbcol) from $tb
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step3
sql select max(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
print =============== step4
sql select max(tbcol) as b from $tb
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step5
sql select max(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select max(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step6
sql select max(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select max(tbcol) from $mt
print ===> $data00
if $data00 != 19 then
return -1
endi
print =============== step8
sql select max(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
sql select max(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 19 then
return -1
endi
sql select max(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 4 then
return -1
endi
print =============== step9
sql select max(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select max(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step10
sql select max(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 19 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select max(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
return -1
endi
print ===> $rows
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_mi_db
$tbPrefix = m_mi_tb
$mtPrefix = m_mi_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select min(tbcol) from $tb
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step3
sql select min(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step4
sql select min(tbcol) as b from $tb
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step5
sql select min(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select min(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step6
sql select min(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select min(tbcol) from $mt
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step8
sql select min(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
sql select min(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 0 then
return -1
endi
sql select min(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 0 then
return -1
endi
print =============== step9
sql select min(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select min(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 0 then
return -1
endi
print =============== step10
sql select min(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 0 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select min(tbcol) as b from $mt where ts < now + 4m interval(1m) group by tgcol
print ===> $data11
if $data11 != 1 then
return -1
endi
print ===> $rows
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_pe_db
$tbPrefix = m_pe_tb
$mtPrefix = m_pe_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select percentile(tbcol, 10) from $tb
print ===> $data00
if $data00 != 1.900000000 then
return -1
endi
sql select percentile(tbcol, 20) from $tb
print ===> $data00
if $data00 != 3.800000000 then
return -1
endi
sql select percentile(tbcol, 100) from $tb
print ===> $data00
if $data00 != 19.000000000 then
return -1
endi
sql select percentile(tbcol, 110) from $tb -x step2
return -1
step2:
print =============== step3
sql select percentile(tbcol, 1) from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.140000000 then
return -1
endi
sql select percentile(tbcol, 5) from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.700000000 then
return -1
endi
sql select percentile(tbcol, 0) from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.000000000 then
return -1
endi
print =============== step4
sql select percentile(tbcol, 1) as c from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.140000000 then
return -1
endi
sql select percentile(tbcol, 5) as c from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.700000000 then
return -1
endi
sql select percentile(tbcol, 0) as c from $tb where ts > now + 4m
print ===> $data00
if $data00 != 5.000000000 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_st_db
$tbPrefix = m_st_tb
$mtPrefix = m_st_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select stddev(tbcol) from $tb
print ===> $data00
if $data00 != 5.766281297 then
return -1
endi
print =============== step3
sql select stddev(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 1.414213562 then
return -1
endi
print =============== step4
sql select stddev(tbcol) as b from $tb
print ===> $data00
if $data00 != 5.766281297 then
return -1
endi
print =============== step5
sql select stddev(tbcol) as b from $tb interval(1m)
print ===> $data01
if $data01 != 0.000000000 then
return -1
endi
sql select stddev(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 5.766281297 then
return -1
endi
print =============== step6
sql select stddev(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data01
if $data01 != 0.000000000 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_su_db
$tbPrefix = m_su_tb
$mtPrefix = m_su_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select sum(tbcol) from $tb
print ===> $data00
if $data00 != 190 then
return -1
endi
print =============== step3
sql select sum(tbcol) from $tb where ts < now + 4m
print ===> $data00
if $data00 != 10 then
return -1
endi
print =============== step4
sql select sum(tbcol) as b from $tb
print ===> $data00
if $data00 != 190 then
return -1
endi
print =============== step5
sql select sum(tbcol) as b from $tb interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
sql select sum(tbcol) as b from $tb interval(1d)
print ===> $data01
if $data01 != 190 then
return -1
endi
print =============== step6
sql select sum(tbcol) as b from $tb where ts < now + 4m interval(1m)
print ===> $data11
if $data11 != 1 then
return -1
endi
if $rows != 5 then
return -1
endi
print =============== step7
sql select sum(tbcol) from $mt
print ===> $data00
if $data00 != 1900 then
return -1
endi
print =============== step8
sql select sum(tbcol) as c from $mt where ts < now + 4m
print ===> $data00
if $data00 != 100 then
return -1
endi
sql select sum(tbcol) as c from $mt where tgcol < 5
print ===> $data00
if $data00 != 950 then
return -1
endi
sql select sum(tbcol) as c from $mt where tgcol < 5 and ts < now + 4m
print ===> $data00
if $data00 != 50 then
return -1
endi
print =============== step9
sql select sum(tbcol) as b from $mt interval(1m)
print ===> $data11
if $data11 < 5 then
return -1
endi
sql select sum(tbcol) as b from $mt interval(1d)
print ===> $data01
if $data01 != 1900 then
return -1
endi
print =============== step10
sql select sum(tbcol) as b from $mt group by tgcol
print ===> $data00
if $data00 != 190 then
return -1
endi
if $rows != $tbNum then
return -1
endi
print =============== step11
sql select sum(tbcol) as b from $mt where ts < now + 4m interval(1d) group by tgcol
print select sum(tbcol) as b from $mt where ts < now + 4m interval(1d) group by tgcol
print ===> $data01
if $data01 != 10 then
return -1
endi
if $rows != 10 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = m_to_db
$tbPrefix = m_to_tb
$mtPrefix = m_to_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol int) TAGS(tgcol int)
$i = 0
while $i < $tbNum
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( $i )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , $x )
$x = $x + 1
endw
$i = $i + 1
endw
sleep 100
print =============== step2
$i = 1
$tb = $tbPrefix . $i
sql select top(tbcol, 1) from $tb
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step3
sql select top(tbcol, 1) from $tb where ts < now + 4m
print ===> $data01
if $data01 != 4 then
return -1
endi
print =============== step4
sql select top(tbcol, 1) as b from $tb
print ===> $data01
if $data01 != 19 then
return -1
endi
print =============== step5
sql select top(tbcol, 2) as b from $tb
print ===> $data01 $data11
if $data01 != 18 then
return -1
endi
if $data11 != 19 then
return -1
endi
print =============== step6
sql select top(tbcol, 2) as b from $tb where ts < now + 4m
print ===> $data01 $data11
if $data01 != 3 then
return -1
endi
if $data11 != 4 then
return -1
endi
sql select top(tbcol, 122) as b from $tb -x step6
return -1
step6:
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
print ============================ dnode1 start
$i = 0
$dbPrefix = ob_db_db
$tbPrefix = ob_db_tb
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
sql create database $db replica 1 duration 20 keep 2000 cache 16
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data06 != 20 then
return -1
endi
if $data08 != 16 then
return -1
endi
print =============== step2
sql create database $db
sql show databases
if $rows != 1 then
return -1
endi
print =============== step3
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
print =============== step4
sql_error drop database $db
print =============== step5
sql create database $db replica 1 duration 15 keep 1500
sql show databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data00 != $db then
return -1
endi
if $data02 != 0 then
return -1
endi
if $data03 != 0 then
return -1
endi
if $data04 != 1 then
return -1
endi
if $data06 != 15 then
return -1
endi
print =============== step6
sql use $db
sql create table $tb (ts timestamp, speed int)
$i = 1
while $i < 4
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
$i = $i + 1
endw
sql show databases
if $rows != 4 then
return -1
endi
$i = 4
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
print =============== step7
$i = 0
while $i < 5
$db = $dbPrefix . $i
sql drop database $db
$i = $i + 1
endw
print =============== step8
$i = 0
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then
return -1
endi
print =============== step9
sql drop database $db
print =============== step10
sql create database $db
sql use $db
sql show tables
if $rows != 0 then
return -1
endi
print =============== step11
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then
return -1
endi
print =============== step12
sql drop database $db
print =============== step13
sql create database $db
sql use $db
sql show tables
if $rows != 0 then
return -1
endi
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then
return -1
endi
sql insert into $tb values (now+1a, 0)
sql insert into $tb values (now+2a, 1)
sql insert into $tb values (now+3a, 2)
sql insert into $tb values (now+4a, 3)
sql insert into $tb values (now+5a, 4)
sql select * from $tb
if $rows != 5 then
return -1
endi
print =============== step14
sql drop database $db
print =============== step15
sql create database $db
sql use $db
sql show tables
if $rows != 0 then
return -1
endi
print =============== step16
sql create table $tb (ts timestamp, speed int)
sql show tables
if $rows != 1 then
return -1
endi
sql select * from $tb
if $rows != 0 then
return -1
endi
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sleep 2000
sql connect
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
print =============== step1
sql_error drop database dd
sql create database -x step1
return -1
step1:
sql show databases
if $rows != 0 then
return -1
endi
print =============== step2
sql create database a
sql show databases
if $rows != 1 then
return -1
endi
sql drop database a
sql show databases
if $rows != 0 then
return -1
endi
print =============== step3
sql create database a12345678
sql show databases
if $rows != 1 then
return -1
endi
sql drop database a12345678
sql show databases
if $rows != 0 then
return -1
endi
print =============== step4
sql create database a012345678901201234567890120123456789012a012345678901201234567890120123456789012 -x step4
return -1
step4:
sql show databases
if $rows != 0 then
return -1
endi
print =============== step5
sql create database a;1
sql drop database a
sql show databases
if $rows != 0 then
return -1
endi
print =============== step6
sql create database a'1 -x step6
return -1
step6:
sql show databases
if $rows != 0 then
return -1
endi
print =============== step7
sql create database (a) -x step7
return -1
step7:
sql show databases
if $rows != 0 then
return -1
endi
print =============== step8
sql create database a.1 -x step8
return -1
step8:
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sql connect
sleep 2000
print ======================== dnode1 start
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = fi_bt_db
$tbPrefix = fi_bt_tb
$mtPrefix = fi_bt_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol2 bool, tbcol int) TAGS(tgcol bool, tgcol2 int)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0, 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0, 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1, 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1, 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where tbcol2 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then
return -1
endi
print =============== step4
sql select * from $mt where ts > now + 4m and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step5
sql select * from $mt where ts > now + 4m and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step6
sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step9
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 50 then
return -1
endi
print =============== step10
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 and tbcol2 = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step11
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step12
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 interval(1d) group by tgcol order by tgcol desc
print $db
print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol2 = 1 interval(1d) group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sql connect
sleep 2000
print ======================== dnode1 start
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = fi_3_db
$tbPrefix = fi_3_tb
$mtPrefix = fi_3_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol1 smallint, tbcol2 int, tbcol3 float) TAGS(tgcol1 smallint, tgcol2 int, tgcol3 float)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 0, 0, 0 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 0, 0, 0 )
$x = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
sql create table $tb using $mt tags( 1, 1, 1 )
$x = 0
while $x < $rowNum
$ms = $x . m
sql insert into $tb values (now + $ms , 1, 1, 1 )
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt
if $rows != $totalNum then
return -1
endi
sql select * from $mt where ts < now + 4m
if $rows != 50 then
return -1
endi
sql select * from $mt where ts > now + 4m
if $rows != 150 then
return -1
endi
sql select * from $mt where ts = now + 4m
if $rows != 0 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m
if $rows != 10 then
return -1
endi
print =============== step3
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol1 <> 0
if $rows != 100 then
return -1
endi
print =============== step4
sql select * from $mt where tbcol2 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol2 <> 1
if $rows != 100 then
return -1
endi
print =============== step5
sql select * from $mt where tbcol3 = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol3 <> 1
if $rows != 100 then
return -1
endi
print =============== step6
sql select * from $mt where ts > now + 4m and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step7
sql select * from $mt where ts > now + 4m and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step8
sql select * from $mt where ts > now + 4m and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step9
sql select * from $mt where ts > now + 4m and tbcol2 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol2 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol2 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step10
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol1 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol1 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol1 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol1 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol1 <> 0
if $rows != 5 then
return -1
endi
print =============== step11
sql select * from $mt where ts > now + 4m and tbcol3 = 1 and tbcol2 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 1 and tbcol2 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 = 0 and tbcol2 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol3 <> 0 and tbcol2 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol3 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0
if $rows != 5 then
return -1
endi
print =============== step12
sql select * from $mt where ts > now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 1 and tbcol2 <> 1 and tbcol3 <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 = 0 and tbcol2 = 0 and tbcol3 = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol1 <> 0 and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol1 <> 0 and ts < now + 5m and ts < now + 5m and tbcol2 <> 0 and tbcol3 <> 0
if $rows != 5 then
return -1
endi
print =============== step13
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step14
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 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 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 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 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step15
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 50 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step16
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt group by tgcol3
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step17
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 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 and tbcol2 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 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 and tbcol2 = 1 and tbcol3 = 1 group by tgcol1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step18
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where ts < now + 4m and tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 group by tgcol2
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step19
sql select count(tbcol1), avg(tbcol1), sum(tbcol1), min(tbcol1), max(tbcol1), first(tbcol1), last(tbcol1) from $mt where tbcol1 = 1 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol1 order by tgcol1 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 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 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol2 order by tgcol2 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 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 and tbcol2 = 1 and tbcol3 = 1 interval(1d) group by tgcol3 order by tgcol3 desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
sql connect
sleep 2000
print ======================== dnode1 start
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = fi_bi_db
$tbPrefix = fi_bi_tb
$mtPrefix = fi_bi_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol bigint) TAGS(tgcol bigint)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
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 = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
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 = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where ts > now + 4m and tbcol = 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 1
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> 0
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> 0
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> 0 and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step4
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step5
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step6
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step7
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = 1 group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step8
sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = 1 interval(1d) group by tgcol order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sql connect
sleep 2000
print ======================== dnode1 start
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = fi_by_db
$tbPrefix = fi_by_tb
$mtPrefix = fi_by_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol binary(10)) TAGS(tgcol binary(10))
$i = 0
while $i < 5
$tb = $tbPrefix . $i
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 = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
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 = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = '0'
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
print select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = '1'
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 tbcol = '1' interval(1d) group by tgcol
#can't filter binary fields
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
sql connect
sleep 2000
print ======================== dnode1 start
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
$dbPrefix = fi_bo_db
$tbPrefix = fi_bo_tb
$mtPrefix = fi_bo_mt
$tbNum = 10
$rowNum = 20
$totalNum = 200
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt = $mtPrefix . $i
sql create database $db
sql use $db
sql create table $mt (ts timestamp, tbcol bool) TAGS(tgcol bool)
$i = 0
while $i < 5
$tb = $tbPrefix . $i
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 = $x + 1
endw
$i = $i + 1
endw
while $i < 10
$tb = $tbPrefix . $i
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 = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 0
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> 1
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = true
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> true
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol = false
if $rows != 100 then
return -1
endi
sql select * from $mt where tbcol <> false
if $rows != 100 then
return -1
endi
print =============== step3
sql select * from $mt where ts > now + 4m and tbcol = true
if $rows != 75 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> true
if $rows != 75 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol = false
if $rows != 25 then
return -1
endi
sql select * from $mt where ts < now + 4m and tbcol <> false
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol = false
if $rows != 25 then
return -1
endi
sql select * from $mt where ts <= now + 4m and tbcol <> false
if $rows != 25 then
return -1
endi
sql select * from $mt where ts > now + 4m and ts < now + 5m and tbcol <> false
if $rows != 5 then
return -1
endi
sql select * from $mt where ts > now + 4m and tbcol <> false and ts < now + 5m
if $rows != 5 then
return -1
endi
print =============== step4
sql select count(tbcol), first(tbcol), last(tbcol) from $mt
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 200 then
return -1
endi
print =============== step5
sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step6
sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 100 then
return -1
endi
print =============== step7
sql select count(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m and tbcol = true group by tgcol
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data00 != 25 then
return -1
endi
print =============== step8
sql select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true interval(1d) group by tgcol order by tgcol desc
print select count(tbcol), first(tbcol), last(tbcol) from $mt where tbcol = true interval(1d) group by tgcol order by tgcol desc
print $data00 $data01 $data02 $data03 $data04 $data05 $data06
if $data01 != 100 then
return -1
endi
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
endi
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
sql connect
sleep 2000
sql show databases
sql drop database $data00 -x e1
e1:
sql show databases
sql drop database $data00 -x e2
e2:
sql create database ibadb
sql use ibadb
sql create table tb(ts timestamp, i int)
print ================= step1
sql import into tb values(1564641710000, 10000)
sql select * from tb;
if $rows != 1 then
return -1
endi
print ================= step2
sql insert into tb values(1564641708000, 8000)
sql select * from tb;
if $rows != 2 then
return -1
endi
print ================= step3
sql insert into tb values(1564641720000, 20000)
sql select * from tb;
if $rows != 3 then
return -1
endi
print ================= step4
sql import into tb values(1564641708000, 8000)
sql import into tb values(1564641715000, 15000)
sql import into tb values(1564641730000, 30000)
sql select * from tb;
if $rows != 5 then
return -1
endi
print ================= step5
sql insert into tb values(1564641708000, 8000)
sql insert into tb values(1564641714000, 14000)
sql insert into tb values(1564641725000, 25000)
sql insert into tb values(1564641740000, 40000)
sql select * from tb;
if $rows != 8 then
return -1
endi
print ================= step6
sql import into tb values(1564641707000, 7000)
sql import into tb values(1564641712000, 12000)
sql import into tb values(1564641723000, 23000)
sql import into tb values(1564641734000, 34000)
sql import into tb values(1564641750000, 50000)
sql select * from tb;
if $rows != 13 then
return -1
endi
print ================= step7
sql import into tb values(1564641707001, 7001)
sql import into tb values(1564641712001, 12001)
sql import into tb values(1564641723001, 23001)
sql import into tb values(1564641734001, 34001)
sql import into tb values(1564641750001, 50001)
sql select * from tb;
if $rows != 18 then
return -1
endi
print ================= step8
sql insert into tb values(1564641708002, 8002)
sql insert into tb values(1564641714002, 14002)
sql insert into tb values(1564641725002, 25002)
sql insert into tb values(1564641900000, 200000)
sql select * from tb;
if $rows != 22 then
return -1
endi
print ================= step9 only insert last one
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000)
sql select * from tb;
if $rows != 25 then
return -1
endi
print ================= step10
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000)
sql select * from tb;
if $rows != 25 then
return -1
endi
print ================= step11
sql import into tb values(1564642400000, 700000)
sql select * from tb;
if $rows != 25 then
return -1
endi
print ================= step12
sql import into tb values(1564641709527, 9527)(1564641709527, 9528)
sql select * from tb;
print rows=> $rows
if $rows != 26 then
return -1
endi
print ================= step13
sql import into tb values(1564641709898, 9898)(1564641709897, 9897)
sql select * from tb;
print rows=> $rows
if $rows != 28 then
return -1
endi
sql drop database ibadb
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册