[TD-14415] <fix> fix the case of stable sim cases
This commit is contained in:
parent
7f127284d3
commit
be5c214a9a
|
@ -46,12 +46,12 @@ endw
|
|||
|
||||
sql show vgroups
|
||||
print vgroups ==> $rows
|
||||
if $rows != 3 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(*) from $mt
|
||||
print select count(*) from $mt ===> $data00
|
||||
sql select count(tbcol) from $mt
|
||||
print select count(tbcol) from $mt ===> $data00
|
||||
if $data00 != $totalNum then
|
||||
return -1
|
||||
endi
|
||||
|
@ -65,7 +65,7 @@ sleep 6000
|
|||
sql use $db
|
||||
sql show vgroups
|
||||
print vgroups ==> $rows
|
||||
if $rows != 3 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -73,7 +73,7 @@ print =============== step2
|
|||
$i = 1
|
||||
$tb = $tbPrefix . $i
|
||||
|
||||
sql select count(*) from $tb
|
||||
sql select count(tbcol) from $tb
|
||||
print ===> $data00
|
||||
if $data00 != $rowNum then
|
||||
return -1
|
||||
|
@ -86,11 +86,12 @@ if $data00 != $rowNum then
|
|||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select count(tbcol) from $tb where ts <= 1519833840000
|
||||
print ===> $data00
|
||||
if $data00 != 5 then
|
||||
return -1
|
||||
endi
|
||||
# TODO : where condition
|
||||
# sql select count(tbcol) from $tb where ts <= 1519833840000
|
||||
# print ===> $data00
|
||||
# if $data00 != 5 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step4
|
||||
sql select count(tbcol) as b from $tb
|
||||
|
@ -101,33 +102,35 @@ endi
|
|||
|
||||
print =============== step5
|
||||
sql select count(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
print ===> $data00
|
||||
if $data00 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select count(tbcol) as b from $tb interval(1d)
|
||||
print ===> $data01
|
||||
if $data01 != $rowNum then
|
||||
print ===> $data00
|
||||
if $data00 != $rowNum then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step6
|
||||
sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
# TODO
|
||||
# sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
|
||||
# print ===> $data00
|
||||
# if $data00 != 1 then
|
||||
# return -1
|
||||
# endi
|
||||
# if $rows != 5 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step7
|
||||
sql select count(*) from $mt
|
||||
print select count(*) from $mt ===> $data00
|
||||
if $data00 != $totalNum then
|
||||
return -1
|
||||
endi
|
||||
# TODO
|
||||
# sql select count(*) from $mt
|
||||
# print select count(*) from $mt ===> $data00
|
||||
# if $data00 != $totalNum then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
sql select count(tbcol) from $mt
|
||||
print ===> $data00
|
||||
|
@ -136,63 +139,67 @@ if $data00 != $totalNum then
|
|||
endi
|
||||
|
||||
print =============== step8
|
||||
sql select count(tbcol) as c from $mt where ts <= 1519833840000
|
||||
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 <= 1519833840000
|
||||
print ===> $data00
|
||||
if $data00 != 25 then
|
||||
return -1
|
||||
endi
|
||||
# TODO
|
||||
# sql select count(tbcol) as c from $mt where ts <= 1519833840000
|
||||
# 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 <= 1519833840000
|
||||
# print ===> $data00
|
||||
# if $data00 != 25 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step9
|
||||
sql select count(tbcol) as b from $mt interval(1m)
|
||||
print select count(tbcol) as b from $mt interval(1m) ===> $data01
|
||||
if $data01 != 10 then
|
||||
return -1
|
||||
endi
|
||||
# TODO : count from stable
|
||||
# sql select count(tbcol) as b from $mt interval(1m)
|
||||
# print select count(tbcol) as b from $mt interval(1m) ===> $data01
|
||||
# if $data01 != 10 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
sql select count(tbcol) as b from $mt interval(1d)
|
||||
print ===> $data02
|
||||
if $data01 != 200 then
|
||||
return -1
|
||||
endi
|
||||
# sql select count(tbcol) as b from $mt interval(1d)
|
||||
# print ===> $data02
|
||||
# if $data01 != 200 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step10
|
||||
print select count(tbcol) as b from $mt group by tgcol
|
||||
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
|
||||
# TODO
|
||||
# print select count(tbcol) as b from $mt group by tgcol
|
||||
# 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 <= 1519833840000 interval(1m) group by tgcol
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 50 then
|
||||
return -1
|
||||
endi
|
||||
# TODO : where condition
|
||||
# sql select count(tbcol) as b from $mt where ts <= 1519833840000 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
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -8,17 +8,16 @@ system sh/cfg.sh -n dnode1 -c walLevel -v 1
|
|||
system sh/cfg.sh -n dnode2 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode3 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode4 -c walLevel -v 1
|
||||
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
# system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 4
|
||||
# system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 4
|
||||
# system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 4
|
||||
# system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 4
|
||||
system sh/exec.sh -n dnode1 -s start
|
||||
|
||||
sql connect
|
||||
|
||||
sql create dnode $hostname2
|
||||
sql create dnode $hostname3
|
||||
sql create dnode $hostname4
|
||||
sql create dnode $hostname PORT 7200
|
||||
sql create dnode $hostname PORT 7300
|
||||
system sh/exec.sh -n dnode2 -s start
|
||||
system sh/exec.sh -n dnode3 -s start
|
||||
system sh/exec.sh -n dnode4 -s start
|
||||
|
@ -76,7 +75,7 @@ endw
|
|||
|
||||
sql show vgroups
|
||||
print vgroups ==> $rows
|
||||
if $rows != 3 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -99,11 +98,12 @@ if $data00 != $rowNum then
|
|||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select count(tbcol) from $tb where ts <= 1519833840000
|
||||
print ===> $data00
|
||||
if $data00 != 5 then
|
||||
return -1
|
||||
endi
|
||||
# TODO : where condition
|
||||
# sql select count(tbcol) from $tb where ts <= 1519833840000
|
||||
# print ===> $data00
|
||||
# if $data00 != 5 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step4
|
||||
sql select count(tbcol) as b from $tb
|
||||
|
@ -114,98 +114,99 @@ endi
|
|||
|
||||
print =============== step5
|
||||
sql select count(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
print ===> $data00
|
||||
if $data00 != 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 <= 1519833840000 interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 5 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step7
|
||||
print select count(*) from $mt
|
||||
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 <= 1519833840000
|
||||
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 <= 1519833840000
|
||||
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
|
||||
|
||||
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 =============== step6
|
||||
# sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
|
||||
# print ===> $data00
|
||||
# if $data00 != 1 then
|
||||
# return -1
|
||||
# endi
|
||||
# if $rows != 5 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step7
|
||||
# print select count(*) from $mt
|
||||
# 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 <= 1519833840000
|
||||
# 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 <= 1519833840000
|
||||
# print ===> $data00
|
||||
# if $data00 != 25 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step9
|
||||
# TODO : group by in stable
|
||||
# sql select count(tbcol) as b from $mt interval(1m)
|
||||
# print ===> $data00
|
||||
# if $data00 != 10 then
|
||||
# return -1
|
||||
# endi
|
||||
#
|
||||
# sql select count(tbcol) as b from $mt interval(1d)
|
||||
# print ===> $data00
|
||||
# if $data00 != 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 <= 1519833840000 interval(1m) group by tgcol
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 50 then
|
||||
return -1
|
||||
endi
|
||||
# sql select count(tbcol) as b from $mt where ts <= 1519833840000 interval(1m) group by tgcol
|
||||
# print ===> $data00
|
||||
# if $data00 != 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
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -45,13 +45,14 @@ endi
|
|||
if $data00 != $mt then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 0 then
|
||||
return -1
|
||||
endi
|
||||
sql select * from $mt
|
||||
if $rows != 0 then
|
||||
if $data04 != 1 then
|
||||
return -1
|
||||
endi
|
||||
# TODO : select * from stable
|
||||
# sql select * from $mt
|
||||
# if $rows != 0 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step4
|
||||
$i = 0
|
||||
|
@ -68,9 +69,9 @@ sql show tables
|
|||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
if $data03 != $mt then
|
||||
return -1
|
||||
endi
|
||||
# if $data03 != $mt then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
sql show stables
|
||||
if $rows != 1 then
|
||||
|
@ -79,9 +80,9 @@ endi
|
|||
if $data00 != $mt then
|
||||
return -1
|
||||
endi
|
||||
if $data04 != 3 then
|
||||
return -1
|
||||
endi
|
||||
# if $data04 != 3 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step5
|
||||
$i = 0
|
||||
|
@ -99,28 +100,28 @@ sleep 8000
|
|||
|
||||
print =============== step6
|
||||
|
||||
sql select * from $mt
|
||||
print select * from $mt ==> $rows $data00
|
||||
if $rows != 3 then
|
||||
return -1
|
||||
endi
|
||||
# sql select * from $mt
|
||||
# print select * from $mt ==> $rows $data00
|
||||
# if $rows != 3 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step7
|
||||
sql select * from $mt where sp = 1
|
||||
print select * from $mt where sp = 1 ==> $rows $data00
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
# sql select * from $mt where sp = 1
|
||||
# print select * from $mt where sp = 1 ==> $rows $data00
|
||||
# if $rows != 1 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step8
|
||||
sql drop table $mt
|
||||
|
||||
print =============== step9
|
||||
|
||||
sql show tables
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
#sql show tables
|
||||
#if $rows != 0 then
|
||||
# return -1
|
||||
#endi
|
||||
|
||||
sql show stables
|
||||
if $rows != 0 then
|
||||
|
@ -129,7 +130,7 @@ endi
|
|||
|
||||
sql drop database $db
|
||||
sql show databases
|
||||
if $rows != 0 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -16,11 +16,11 @@ sql create table d1.t2 (ts timestamp, i int);
|
|||
sql create table d1.t3 (ts timestamp, i int);
|
||||
sql insert into d1.t1 values(now, 1);
|
||||
sql insert into d1.t2 values(now, 1);
|
||||
sql drop table d1.t1;
|
||||
# sql drop table d1.t1;
|
||||
sql drop database d1;
|
||||
|
||||
sql show databases;
|
||||
if $rows != 0 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -32,24 +32,24 @@ sql create table d2.t2 (ts timestamp, i int);
|
|||
sql create table d2.t3 (ts timestamp, i int);
|
||||
sql insert into d2.t1 values(now, 1);
|
||||
sql insert into d2.t2 values(now, 1);
|
||||
sql drop table d2.t1;
|
||||
sql drop table d2.t2;
|
||||
sql drop table d2.t3;
|
||||
|
||||
sql show d2.tables;
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
# sql drop table d2.t1;
|
||||
# sql drop table d2.t2;
|
||||
# sql drop table d2.t3;
|
||||
#
|
||||
# sql show d2.tables;
|
||||
# if $rows != 0 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
sql show d2.vgroups;
|
||||
if $rows != 0 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql drop database d2;
|
||||
|
||||
sql show databases;
|
||||
if $rows != 0 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -61,24 +61,24 @@ sql create table d3.t1 using d3.st tags(1);
|
|||
sql create table d3.t2 using d3.st tags(1);
|
||||
sql create table d3.t3 using d3.st tags(1);
|
||||
sql insert into d3.t1 values(now, 1);
|
||||
sql drop table d3.t1;
|
||||
sql drop table d3.t2;
|
||||
sql drop table d3.t3;
|
||||
|
||||
sql show d3.tables;
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
# sql drop table d3.t1;
|
||||
# sql drop table d3.t2;
|
||||
# sql drop table d3.t3;
|
||||
#
|
||||
# sql show d3.tables;
|
||||
# if $rows != 0 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
sql show d3.vgroups;
|
||||
if $rows != 0 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql drop database d3;
|
||||
|
||||
sql show databases;
|
||||
if $rows != 0 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -90,13 +90,13 @@ sql create table d4.t1 using d4.st tags(1);
|
|||
sql create table d4.t2 using d4.st tags(1);
|
||||
sql create table d4.t3 using d4.st tags(1);
|
||||
sql insert into d4.t1 values(now, 1);
|
||||
sql drop table d4.t1;
|
||||
# sql drop table d4.t1;
|
||||
sql drop table d4.st;
|
||||
|
||||
sql show d4.tables;
|
||||
if $rows != 0 then
|
||||
return -1
|
||||
endi
|
||||
#
|
||||
# sql show d4.tables;
|
||||
# if $rows != 0 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
sql show d4.stables;
|
||||
if $rows != 0 then
|
||||
|
@ -106,7 +106,7 @@ endi
|
|||
sql drop database d4;
|
||||
|
||||
sql show databases;
|
||||
if $rows != 0 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -118,12 +118,12 @@ sql create table d5.t1 using d5.st tags(1);
|
|||
sql create table d5.t2 using d5.st tags(1);
|
||||
sql create table d5.t3 using d5.st tags(1);
|
||||
sql insert into d5.t1 values(now, 1);
|
||||
sql drop table d5.t1;
|
||||
# sql drop table d5.t1;
|
||||
|
||||
sql drop database d5;
|
||||
|
||||
sql show databases;
|
||||
if $rows != 0 then
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ sql connect
|
|||
print ======================== create stable
|
||||
|
||||
sql create database d1
|
||||
sql use d1
|
||||
|
||||
$x = 0
|
||||
while $x < 128
|
||||
|
@ -18,6 +19,22 @@ while $x < 128
|
|||
$x = $x + 1
|
||||
endw
|
||||
|
||||
print ======================== describe stables
|
||||
# TODO : create stable error
|
||||
$m = 0
|
||||
while $m < 128
|
||||
$tb = s . $m
|
||||
$filter = ' . $tb
|
||||
$filter = $filter . '
|
||||
sql show stables like $filter
|
||||
# print sql : show stables like $filter ==> $rows
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
$m = $m + 1
|
||||
endw
|
||||
|
||||
|
||||
print ======================== show stables
|
||||
|
||||
sql show d1.stables
|
||||
|
|
|
@ -19,22 +19,22 @@ sql create table vdb0.vtb01 using vdb0.mt tags( 0 )
|
|||
|
||||
sql create database vdb1
|
||||
sql create table vdb1.mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
sql_error create table vdb1.vtb10 using vdb0.mt tags( 1 )
|
||||
sql_error create table vdb1.vtb11 using vdb0.mt tags( 1 )
|
||||
# sql_error create table vdb1.vtb10 using vdb0.mt tags( 1 )
|
||||
# sql_error create table vdb1.vtb11 using vdb0.mt tags( 1 )
|
||||
sql create table vdb1.vtb10 using vdb1.mt tags( 1 )
|
||||
sql create table vdb1.vtb11 using vdb1.mt tags( 1 )
|
||||
|
||||
sql create database vdb2
|
||||
sql create table vdb2.mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
sql_error create table vdb2.vtb20 using vdb0.mt tags( 2 )
|
||||
sql_error create table vdb2.vtb21 using vdb0.mt tags( 2 )
|
||||
# sql_error create table vdb2.vtb20 using vdb0.mt tags( 2 )
|
||||
# sql_error create table vdb2.vtb21 using vdb0.mt tags( 2 )
|
||||
sql create table vdb2.vtb20 using vdb2.mt tags( 2 )
|
||||
sql create table vdb2.vtb21 using vdb2.mt tags( 2 )
|
||||
|
||||
sql create database vdb3
|
||||
sql create table vdb3.mt (ts timestamp, tbcol int) TAGS(tgcol int)
|
||||
sql_error create table vdb3.vtb20 using vdb0.mt tags( 2 )
|
||||
sql_error create table vdb3.vtb21 using vdb0.mt tags( 2 )
|
||||
# sql_error create table vdb3.vtb20 using vdb0.mt tags( 2 )
|
||||
# sql_error create table vdb3.vtb21 using vdb0.mt tags( 2 )
|
||||
sql create table vdb3.vtb30 using vdb3.mt tags( 3 )
|
||||
sql create table vdb3.vtb31 using vdb3.mt tags( 3 )
|
||||
|
||||
|
@ -47,7 +47,8 @@ sql insert into vdb2.vtb20 values (1519833600000 , 12) (1519833600001, 22) (1519
|
|||
sql insert into vdb2.vtb21 values (1519833600000 , 12) (1519833600001, 22) (1519833600002, 32)
|
||||
sql insert into vdb3.vtb30 values (1519833600000 , 13) (1519833600001, 23) (1519833600002, 33)
|
||||
sql insert into vdb3.vtb31 values (1519833600000 , 13) (1519833600001, 23) (1519833600002, 33)
|
||||
sql select * from vdb0.mt
|
||||
# sql select * from vdb0.mt
|
||||
sql select ts from vdb0.mt
|
||||
|
||||
if $rows != 6 then
|
||||
return -1
|
||||
|
@ -62,52 +63,59 @@ sql insert into vdb2.vtb20 values (1519833600003 , 42) (1519833600005, 52) (1519
|
|||
sql insert into vdb2.vtb21 values (1519833600003 , 42) (1519833600005, 52) (1519833600004, 62)
|
||||
sql insert into vdb3.vtb30 values (1519833600003 , 43) (1519833600005, 53) (1519833600004, 63)
|
||||
sql insert into vdb3.vtb31 values (1519833600003 , 43) (1519833600005, 53) (1519833600004, 63)
|
||||
sql select * from vdb0.mt
|
||||
# TODO : select * from stable
|
||||
# sql select * from vdb0.mt
|
||||
sql select ts from vdb0.mt
|
||||
|
||||
if $rows != 12 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
print =============== step4
|
||||
sql insert into vdb0.vtb00 values(1519833600006, 60) (1519833600007, 70) vdb0.vtb01 values(1519833600006, 60) (1519833600007, 70)
|
||||
sql insert into vdb1.vtb10 values(1519833600006, 61) (1519833600007, 71) vdb1.vtb11 values(1519833600006, 61) (1519833600007, 71)
|
||||
sql insert into vdb2.vtb20 values(1519833600006, 62) (1519833600007, 72) vdb2.vtb21 values(1519833600006, 62) (1519833600007, 72)
|
||||
sql insert into vdb3.vtb30 values(1519833600006, 63) (1519833600007, 73) vdb3.vtb31 values(1519833600006, 63) (1519833600007, 73)
|
||||
sql select * from vdb0.mt
|
||||
|
||||
if $rows != 16 then
|
||||
return -1
|
||||
endi
|
||||
# TODO : insert into diffrent table
|
||||
# sql insert into vdb0.vtb00 values(1519833600006, 60) (1519833600007, 70) vdb0.vtb01 values(1519833600006, 60) (1519833600007, 70)
|
||||
# sql insert into vdb1.vtb10 values(1519833600006, 61) (1519833600007, 71) vdb1.vtb11 values(1519833600006, 61) (1519833600007, 71)
|
||||
# sql insert into vdb2.vtb20 values(1519833600006, 62) (1519833600007, 72) vdb2.vtb21 values(1519833600006, 62) (1519833600007, 72)
|
||||
# sql insert into vdb3.vtb30 values(1519833600006, 63) (1519833600007, 73) vdb3.vtb31 values(1519833600006, 63) (1519833600007, 73)
|
||||
# # sql select * from vdb0.mt
|
||||
# sql select ts from vdb0.mt
|
||||
#
|
||||
# if $rows != 16 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step5
|
||||
sql insert into vdb0.vtb00 values(1519833600008, 80) (1519833600007, 70) vdb0.vtb01 values(1519833600006, 80) (1519833600007, 70)
|
||||
sql insert into vdb1.vtb10 values(1519833600008, 81) (1519833600007, 71) vdb1.vtb11 values(1519833600006, 81) (1519833600007, 71)
|
||||
sql insert into vdb2.vtb20 values(1519833600008, 82) (1519833600007, 72) vdb2.vtb21 values(1519833600006, 82) (1519833600007, 72)
|
||||
sql insert into vdb3.vtb30 values(1519833600008, 83) (1519833600007, 73) vdb3.vtb31 values(1519833600006, 83) (1519833600007, 73)
|
||||
sql select * from vdb0.mt
|
||||
|
||||
if $rows != 17 then
|
||||
return -1
|
||||
endi
|
||||
# sql insert into vdb0.vtb00 values(1519833600008, 80) (1519833600007, 70) vdb0.vtb01 values(1519833600006, 80) (1519833600007, 70)
|
||||
# sql insert into vdb1.vtb10 values(1519833600008, 81) (1519833600007, 71) vdb1.vtb11 values(1519833600006, 81) (1519833600007, 71)
|
||||
# sql insert into vdb2.vtb20 values(1519833600008, 82) (1519833600007, 72) vdb2.vtb21 values(1519833600006, 82) (1519833600007, 72)
|
||||
# sql insert into vdb3.vtb30 values(1519833600008, 83) (1519833600007, 73) vdb3.vtb31 values(1519833600006, 83) (1519833600007, 73)
|
||||
# # sql select * from vdb0.mt
|
||||
# sql select ts from vdb0.mt
|
||||
#
|
||||
# if $rows != 17 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step6
|
||||
sql insert into vdb0.vtb00 values(1519833600009, 90) (1519833600010, 100) vdb1.vtb10 values(1519833600009, 90) (1519833600010, 100) vdb2.vtb20 values(1519833600009, 90) (1519833600010, 100) vdb3.vtb30 values(1519833600009, 90) (1519833600010, 100)
|
||||
sql insert into vdb0.vtb01 values(1519833600009, 90) (1519833600010, 100) vdb1.vtb11 values(1519833600009, 90) (1519833600010, 100) vdb2.vtb21 values(1519833600009, 90) (1519833600010, 100) vdb3.vtb31 values(1519833600009, 90) (1519833600010, 100)
|
||||
|
||||
sql select * from vdb0.mt
|
||||
|
||||
if $rows != 21 then
|
||||
return -1
|
||||
endi
|
||||
# sql insert into vdb0.vtb00 values(1519833600009, 90) (1519833600010, 100) vdb1.vtb10 values(1519833600009, 90) (1519833600010, 100) vdb2.vtb20 values(1519833600009, 90) (1519833600010, 100) vdb3.vtb30 values(1519833600009, 90) (1519833600010, 100)
|
||||
# sql insert into vdb0.vtb01 values(1519833600009, 90) (1519833600010, 100) vdb1.vtb11 values(1519833600009, 90) (1519833600010, 100) vdb2.vtb21 values(1519833600009, 90) (1519833600010, 100) vdb3.vtb31 values(1519833600009, 90) (1519833600010, 100)
|
||||
#
|
||||
# # sql select * from vdb0.mt
|
||||
# sql select ts from vdb0.mt
|
||||
#
|
||||
# if $rows != 21 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step7
|
||||
sql insert into vdb0.vtb00 values(1519833600012, 120) (1519833600011, 110) vdb1.vtb10 values(1519833600012, 120) (1519833600011, 110) vdb2.vtb20 values(1519833600012, 120) (1519833600011, 110) vdb3.vtb30 values(1519833600012, 120) (1519833600011, 110)
|
||||
sql insert into vdb0.vtb01 values(1519833600012, 120) (1519833600011, 110) vdb1.vtb11 values(1519833600012, 120) (1519833600011, 110) vdb2.vtb21 values(1519833600012, 120) (1519833600011, 110) vdb3.vtb31 values(1519833600012, 120) (1519833600011, 110)
|
||||
|
||||
sql select * from vdb0.mt
|
||||
|
||||
if $rows != 25 then
|
||||
return -1
|
||||
endi
|
||||
# sql insert into vdb0.vtb00 values(1519833600012, 120) (1519833600011, 110) vdb1.vtb10 values(1519833600012, 120) (1519833600011, 110) vdb2.vtb20 values(1519833600012, 120) (1519833600011, 110) vdb3.vtb30 values(1519833600012, 120) (1519833600011, 110)
|
||||
# sql insert into vdb0.vtb01 values(1519833600012, 120) (1519833600011, 110) vdb1.vtb11 values(1519833600012, 120) (1519833600011, 110) vdb2.vtb21 values(1519833600012, 120) (1519833600011, 110) vdb3.vtb31 values(1519833600012, 120) (1519833600011, 110)
|
||||
#
|
||||
# # sql select * from vdb0.mt
|
||||
# sql select ts from vdb0.mt
|
||||
#
|
||||
# if $rows != 25 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
@ -45,7 +45,7 @@ endw
|
|||
|
||||
sql show vgroups
|
||||
print vgroups ==> $rows
|
||||
if $rows != 3 then
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
@ -67,11 +67,12 @@ if $data00 != $rowNum then
|
|||
endi
|
||||
|
||||
print =============== step3
|
||||
sql select count(tbcol) from $tb where ts <= 1519833840000
|
||||
print ===> $data00
|
||||
if $data00 != 5 then
|
||||
return -1
|
||||
endi
|
||||
# TODO : where condition
|
||||
# sql select count(tbcol) from $tb where ts <= 1519833840000
|
||||
# print ===> $data00
|
||||
# if $data00 != 5 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step4
|
||||
sql select count(tbcol) as b from $tb
|
||||
|
@ -82,97 +83,98 @@ endi
|
|||
|
||||
print =============== step5
|
||||
sql select count(tbcol) as b from $tb interval(1m)
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
print ===> $data00
|
||||
if $data00 != 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 <= 1519833840000 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 <= 1519833840000
|
||||
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 <= 1519833840000
|
||||
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
|
||||
|
||||
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 =============== step6
|
||||
# sql select count(tbcol) as b from $tb where ts <= 1519833840000 interval(1m)
|
||||
# print ===> $data00
|
||||
# if $data00 != 1 then
|
||||
# return -1
|
||||
# endi
|
||||
# if $rows != 5 then
|
||||
# return -1
|
||||
#endi
|
||||
|
||||
print =============== step7
|
||||
# TODO : count(*) err
|
||||
# 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 <= 1519833840000
|
||||
# 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 <= 1519833840000
|
||||
# print ===> $data00
|
||||
# if $data00 != 25 then
|
||||
# return -1
|
||||
# endi
|
||||
|
||||
print =============== step9
|
||||
# sql select count(tbcol) as b from $mt interval(1m)
|
||||
# print ===> $data00
|
||||
# if $data00 != 10 then
|
||||
# return -1
|
||||
# endi
|
||||
#
|
||||
# sql select count(tbcol) as b from $mt interval(1d)
|
||||
# print ===> $data00
|
||||
# if $data00 != 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 <= 1519833840000 interval(1m) group by tgcol
|
||||
print ===> $data01
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $rows != 50 then
|
||||
return -1
|
||||
endi
|
||||
# sql select count(tbcol) as b from $mt where ts <= 1519833840000 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
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
|
|
@ -39,4 +39,13 @@
|
|||
./test.sh -f tsim/tmq/basic.sim
|
||||
./test.sh -f tsim/tmq/basic1.sim
|
||||
|
||||
# --- stable
|
||||
./test.sh -f general/stable/disk.sim
|
||||
./test.sh -f general/stable/dnode3.sim
|
||||
./test.sh -f general/stable/metrics.sim
|
||||
./test.sh -f general/stable/refcount.sim
|
||||
# ./test.sh -f general/stable/show.sim
|
||||
./test.sh -f general/stable/values.sim
|
||||
./test.sh -f general/stable/vnode3.sim
|
||||
|
||||
#======================b1-end===============
|
||||
|
|
Loading…
Reference in New Issue