test: valgrind case

This commit is contained in:
Shengliang Guan 2022-07-18 10:57:56 +08:00
parent 1ea48b62c8
commit bd4e24cc80
9 changed files with 397 additions and 367 deletions

View File

@ -249,9 +249,7 @@ endi
print ============== step18
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
sleep 3000
#sql select count(g) from tb
#if $data00 != 12 then

View File

@ -77,12 +77,11 @@ if $data00 != $rowNum then
endi
print =============== step3
# TODO : where condition
# sql select count(tbcol) from $tb where ts <= 1519833840000
# print ===> $data00
# if $data00 != 5 then
# return -1
# endi
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
@ -105,89 +104,82 @@ if $data00 != $rowNum then
endi
print =============== step6
# 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
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
# sql select count(*) from $mt
# print select count(*) from $mt ===> $data00
# if $data00 != $totalNum then
# return -1
# endi
sql select count(*) from $mt
print select count(*) from $mt ===> $data00
if $data00 != $totalNum then
return -1
endi
# TODO
# print ==========> block opt will cause this crash, table scan need to fix this during plan gen ===============>
#sql select count(tbcol) from $mt
#print ===> $data00
#if $data00 != $totalNum then
# return -1
#endi
print ==========> block opt will cause this crash, table scan need to fix this during plan gen ===============>
sql select count(tbcol) from $mt
print ===> $data00
if $data00 != $totalNum then
return -1
endi
print =============== step8
# 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
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 : 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(1m)
print select count(tbcol) as b from $mt interval(1m) ===> $data01
if $data00 != 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 $data00 != 200 then
return -1
endi
print =============== step10
# 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
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
# if $rows != $tbNum then
# return -1
# endi
#
print =============== step11
# 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
sql select count(tbcol) as b from $mt where ts <= 1519833840000 partition by tgcol interval(1m)
print ===> $data01
if $data00 != 1 then
return -1
endi
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db

View File

@ -86,12 +86,11 @@ if $data00 != $rowNum then
endi
print =============== step3
# TODO : where condition
# sql select count(tbcol) from $tb where ts <= 1519833840000
# print ===> $data00
# if $data00 != 5 then
# return -1
# endi
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,82 +113,81 @@ if $data00 != $rowNum then
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
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 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
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
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
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 ===> $data00
# if $data00 != 1 then
# return -1
# endi
# if $rows != 50 then
# return -1
# endi
sql select count(tbcol) as b from $mt where ts <= 1519833840000 partition by tgcol interval(1m)
print ===> $data00
if $data00 != 1 then
return -1
endi
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db

View File

@ -24,17 +24,15 @@ if $rows != 1 then
return -1
endi
#TODO OPEN THIS WHEN STABLE DELETE WORKS
#print =============== step2
#sql drop table $mt
#sql show stables
#if $rows != 0 then
# return -1
#endi
print =============== step2
sql drop table $mt
sql show stables
if $rows != 0 then
return -1
endi
#print =============== step3
#sql create table $mt (ts timestamp, speed int) TAGS(sp int)
#TODO OPEN THIS WHEN STABLE DELETE WORKS
print =============== step3
sql create table $mt (ts timestamp, speed int) TAGS(sp int)
sql show stables
if $rows != 1 then
@ -46,11 +44,10 @@ endi
if $data04 != 1 then
return -1
endi
# TODO : select * from stable
# sql select * from $mt
# if $rows != 0 then
# return -1
# endi
sql select * from $mt
if $rows != 0 then
return -1
endi
print =============== step4
$i = 0
@ -67,9 +64,9 @@ sql show tables
if $rows != 3 then
return -1
endi
# if $data03 != $mt then
# return -1
# endi
if $data04 != $mt then
return -1
endi
sql show stables
if $rows != 1 then
@ -78,9 +75,9 @@ endi
if $data00 != $mt then
return -1
endi
# if $data04 != 3 then
# return -1
# endi
if $data03 != 2 then
return -1
endi
print =============== step5
$i = 0
@ -95,28 +92,28 @@ sql insert into $tb values (now + 1m , 1 )
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

View File

@ -11,7 +11,7 @@ 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;
@ -27,14 +27,14 @@ 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 != 2 then
@ -56,14 +56,14 @@ 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 != 2 then
@ -85,13 +85,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
@ -113,7 +113,7 @@ 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;

View File

@ -31,7 +31,6 @@ if $rows != 1 then
return -1
endi
sql select * from db.stb where t1 < 1
if $rows != 0 then
return -=1

View File

@ -12,22 +12,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 )
@ -40,7 +40,7 @@ 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
@ -56,8 +56,7 @@ 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)
# TODO : select * from stable
# sql select * from vdb0.mt
sql select * from vdb0.mt
sql select ts from vdb0.mt
if $rows != 12 then
@ -65,50 +64,49 @@ if $rows != 12 then
endi
print =============== step4
# 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
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
# sql select ts 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
# sql select ts 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
# sql select ts 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

View File

@ -60,12 +60,11 @@ if $data00 != $rowNum then
endi
print =============== step3
# TODO : where condition
# sql select count(tbcol) from $tb where ts <= 1519833840000
# print ===> $data00
# if $data00 != 5 then
# return -1
# endi
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
@ -88,81 +87,80 @@ if $data00 != $rowNum then
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
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
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 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
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
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
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
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 partition by tgcol interval(1m)
print ===> $data00
if $data00 != 1 then
return -1
endi
if $rows != 50 then
return -1
endi
print =============== clear
sql drop database $db

View File

@ -1,49 +1,99 @@
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c debugflag -v 131
system sh/exec.sh -n dnode1 -s start -v
sql connect
print ======== step1
sql drop database if exists db1;
sql create database db1 vgroups 3;
sql use db1;
sql create stable st1 (ts timestamp, f1 int, f2 binary(200)) tags(t1 int);
sql create table tb1 using st1 tags(1);
sql insert into tb1 values ('2022-07-07 10:01:01', 11, "aaa");
sql insert into tb1 values ('2022-07-07 11:01:02', 12, "bbb");
sql create table tb2 using st1 tags(2);
sql insert into tb2 values ('2022-07-07 10:02:01', 21, "aaa");
sql insert into tb2 values ('2022-07-07 11:02:02', 22, "bbb");
sql create table tb3 using st1 tags(3);
sql insert into tb3 values ('2022-07-07 10:03:01', 31, "aaa");
sql insert into tb3 values ('2022-07-07 11:03:02', 32, "bbb");
sql create table tb4 using st1 tags(4);
sql insert into tb4 select * from tb1;
sql select * from tb4;
if $rows != 2 then
print =============== step1: create drop show dnodes
$x = 0
step1:
$x = $x + 1
sleep 1000
if $x == 10 then
print ---> dnode not ready!
return -1
endi
sql show dnodes
print ---> $data00 $data01 $data02 $data03 $data04 $data05
if $rows != 1 then
return -1
endi
if $data(1)[4] != ready then
goto step1
endi
sql insert into tb4 select ts,f1,f2 from st1;
sql select * from tb4;
if $rows != 6 then
return -1
endi
sql create table tba (ts timestamp, f1 binary(10), f2 bigint, f3 double);
sql_error insert into tba select * from tb1;
sql insert into tba (ts,f2,f1) select * from tb1;
sql select * from tba;
if $rows != 2 then
return -1
endi
sql create table tbb (ts timestamp, f1 binary(10), f2 bigint, f3 double);
sql insert into tbb (f2,f1,ts) select f1+1,f2,ts+3 from tb2;
sql select * from tbb;
if $rows != 2 then
return -1
endi
print =============== step2: create db
sql create database db
sql use db
sql create table db.stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 float, t3 binary(16)) comment "abd"
sql create table db.c1 using db.stb tags(101, 102, "103")
print =============== step3: alter stb
sql_error alter table db.stb add column ts int
sql alter table db.stb add column c3 int
sql alter table db.stb add column c4 bigint
sql alter table db.stb add column c5 binary(12)
sql alter table db.stb drop column c1
sql alter table db.stb drop column c4
sql alter table db.stb MODIFY column c2 binary(32)
sql alter table db.stb add tag t4 bigint
sql alter table db.stb add tag c1 int
sql alter table db.stb add tag t5 binary(12)
sql alter table db.stb drop tag c1
sql alter table db.stb drop tag t5
sql alter table db.stb MODIFY tag t3 binary(32)
sql alter table db.stb rename tag t1 tx
sql alter table db.stb comment 'abcde' ;
sql drop table db.stb
print =============== step4: alter tb
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-28d, -28)
sql select count(a) from tb
sql alter table tb add column b smallint
sql insert into tb values(now-25d, -25, 0)
sql select count(b) from tb
sql alter table tb add column c tinyint
sql insert into tb values(now-22d, -22, 3, 0)
sql select count(c) from tb
sql alter table tb add column d int
sql insert into tb values(now-19d, -19, 6, 0, 0)
sql select count(d) from tb
sql alter table tb add column e bigint
sql alter table tb add column f float
sql alter table tb add column g double
sql alter table tb add column h binary(10)
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from tb
sql select * from tb order by ts desc
print =============== step5: alter stb and insert data
sql create table stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 float, t3 binary(16)) comment "abd"
sql show db.stables
sql describe stb
sql_error alter table stb add column ts int
sql create table db.ctb using db.stb tags(101, 102, "103")
sql insert into db.ctb values(now, 1, "2")
sql show db.tables
sql select * from db.stb
sql select * from tb
sql alter table stb add column c3 int
sql describe stb
sql select * from db.stb
sql select * from tb
sql insert into db.ctb values(now+1s, 1, 2, 3)
sql select * from db.stb
sql alter table db.stb add column c4 bigint
sql select * from db.stb
sql insert into db.ctb values(now+2s, 1, 2, 3, 4)
sql alter table db.stb drop column c1
sql reset query cache
sql select * from tb
sql insert into db.ctb values(now+3s, 2, 3, 4)
sql select * from db.stb
_OVER:
system sh/exec.sh -n dnode1 -s stop -x SIGINT
@ -52,7 +102,7 @@ $null=
system_content sh/checkValgrind.sh -n dnode1
print cmd return result ----> [ $system_content ]
if $system_content > 1 then
if $system_content > 0 then
return -1
endi