Merge pull request #15429 from taosdata/fix/valgrind
test: valgrind case
This commit is contained in:
commit
8db83d6736
|
@ -1,6 +1,7 @@
|
||||||
system sh/stop_dnodes.sh
|
system sh/stop_dnodes.sh
|
||||||
system sh/deploy.sh -n dnode1 -i 1
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
system sh/exec.sh -n dnode1 -s start -v
|
system sh/cfg.sh -n dnode1 -c debugflag -v 131
|
||||||
|
system sh/exec.sh -n dnode1 -s start
|
||||||
sql connect
|
sql connect
|
||||||
|
|
||||||
print =============== step1: create drop show dnodes
|
print =============== step1: create drop show dnodes
|
||||||
|
@ -21,88 +22,73 @@ if $data(1)[4] != ready then
|
||||||
goto step1
|
goto step1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
print =============== step2: create db
|
$tbPrefix = tb
|
||||||
sql create database db
|
$tbNum = 5
|
||||||
|
$rowNum = 10
|
||||||
|
|
||||||
|
print =============== step2: prepare data
|
||||||
|
sql create database db vgroups 2
|
||||||
sql use 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 if not exists stb (ts timestamp, tbcol int, tbcol2 float, tbcol3 double) tags (tgcol int unsigned)
|
||||||
sql create table db.c1 using db.stb tags(101, 102, "103")
|
|
||||||
|
|
||||||
print =============== step3: alter stb
|
$i = 0
|
||||||
sql_error alter table db.stb add column ts int
|
while $i < $tbNum
|
||||||
sql alter table db.stb add column c3 int
|
$tb = $tbPrefix . $i
|
||||||
sql alter table db.stb add column c4 bigint
|
sql create table $tb using stb tags( $i )
|
||||||
sql alter table db.stb add column c5 binary(12)
|
$x = 0
|
||||||
sql alter table db.stb drop column c1
|
while $x < $rowNum
|
||||||
sql alter table db.stb drop column c4
|
$cc = $x * 60000
|
||||||
sql alter table db.stb MODIFY column c2 binary(32)
|
$ms = 1601481600000 + $cc
|
||||||
sql alter table db.stb add tag t4 bigint
|
sql insert into $tb values ($ms , $x , $x , $x )
|
||||||
sql alter table db.stb add tag c1 int
|
$x = $x + 1
|
||||||
sql alter table db.stb add tag t5 binary(12)
|
endw
|
||||||
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
|
$cc = $x * 60000
|
||||||
sql create table tb (ts timestamp, a int)
|
$ms = 1601481600000 + $cc
|
||||||
sql insert into tb values(now-28d, -28)
|
sql insert into $tb values ($ms , NULL , NULL , NULL )
|
||||||
sql select count(a) from tb
|
$i = $i + 1
|
||||||
sql alter table tb add column b smallint
|
endw
|
||||||
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
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
sql create table stb (ts timestamp, c1 int, c2 binary(4)) tags(t1 int, t2 float, t3 binary(16)) comment "abd"
|
system sh/exec.sh -n dnode1 -s start -v
|
||||||
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")
|
print =============== step3: tb
|
||||||
sql insert into db.ctb values(now, 1, "2")
|
sql select avg(tbcol) from tb1
|
||||||
sql show db.tables
|
sql select avg(tbcol) from tb1 where ts <= 1601481840000
|
||||||
sql select * from db.stb
|
sql select avg(tbcol) as b from tb1
|
||||||
sql select * from tb
|
sql select avg(tbcol) as b from tb1 interval(1d)
|
||||||
|
sql select avg(tbcol) as b from tb1 where ts <= 1601481840000 interval(1m)
|
||||||
|
sql select bottom(tbcol, 2) from tb1 where ts <= 1601481840000
|
||||||
|
sql select top(tbcol, 2) from tb1 where ts <= 1601481840000
|
||||||
|
sql select percentile(tbcol, 2) from tb1 where ts <= 1601481840000
|
||||||
|
sql select leastsquares(tbcol, 1, 1) as b from tb1 where ts <= 1601481840000
|
||||||
|
sql show table distributed tb1
|
||||||
|
sql select count(tbcol) as b from tb1 where ts <= 1601481840000 interval(1m)
|
||||||
|
sql select diff(tbcol) from tb1 where ts <= 1601481840000
|
||||||
|
sql select diff(tbcol) from tb1 where tbcol > 5 and tbcol < 20
|
||||||
|
sql select first(tbcol), last(tbcol) as b from tb1 where ts <= 1601481840000 interval(1m)
|
||||||
|
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), sum(tbcol), stddev(tbcol) from tb1 where ts <= 1601481840000 partition by tgcol interval(1m)
|
||||||
|
#sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from tb1 where ts <= 1601481840000 and ts >= 1601481800000 partition by tgcol interval(1m) fill(value, 0)
|
||||||
|
sql select last_row(*) from tb1 where tbcol > 5 and tbcol < 20
|
||||||
|
|
||||||
sql alter table stb add column c3 int
|
print =============== step4: stb
|
||||||
sql describe stb
|
sql select avg(tbcol) as c from stb
|
||||||
sql select * from db.stb
|
sql select avg(tbcol) as c from stb where ts <= 1601481840000
|
||||||
sql select * from tb
|
sql select avg(tbcol) as c from stb where tgcol < 5 and ts <= 1601481840000
|
||||||
sql insert into db.ctb values(now+1s, 1, 2, 3)
|
sql select avg(tbcol) as c from stb interval(1m)
|
||||||
sql select * from db.stb
|
sql select avg(tbcol) as c from stb interval(1d)
|
||||||
|
sql select avg(tbcol) as b from stb where ts <= 1601481840000 interval(1m)
|
||||||
sql alter table db.stb add column c4 bigint
|
sql select avg(tbcol) as c from stb group by tgcol
|
||||||
sql select * from db.stb
|
sql select avg(tbcol) as b from stb where ts <= 1601481840000 partition by tgcol interval(1m)
|
||||||
sql insert into db.ctb values(now+2s, 1, 2, 3, 4)
|
sql show table distributed stb
|
||||||
|
sql select count(tbcol) as b from stb where ts <= 1601481840000 partition by tgcol interval(1m)
|
||||||
sql alter table db.stb drop column c1
|
sql select diff(tbcol) from stb where ts <= 1601481840000
|
||||||
sql reset query cache
|
sql select first(tbcol), last(tbcol) as c from stb group by tgcol
|
||||||
sql select * from tb
|
sql select first(tbcol), last(tbcol) as b from stb where ts <= 1601481840000 and tbcol2 is null partition by tgcol interval(1m)
|
||||||
sql insert into db.ctb values(now+3s, 2, 3, 4)
|
sql select first(tbcol), last(tbcol) as b from stb where ts <= 1601481840000 partition by tgcol interval(1m)
|
||||||
sql select * from db.stb
|
sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), sum(tbcol), stddev(tbcol) from stb where ts <= 1601481840000 partition by tgcol interval(1m)
|
||||||
|
#sql select count(tbcol), avg(tbcol), max(tbcol), min(tbcol), count(tbcol) from stb where ts <= 1601481840000 and ts >= 1601481800000 partition by tgcol interval(1m) fill(value, 0)
|
||||||
sql alter table db.stb add tag t4 bigint
|
sql select last_row(tbcol), stddev(tbcol) from stb where tbcol > 5 and tbcol < 20 group by tgcol
|
||||||
sql select * from db.stb
|
|
||||||
sql select * from db.stb
|
|
||||||
sql_error create table db.ctb2 using db.stb tags(101, "102")
|
|
||||||
sql create table db.ctb2 using db.stb tags(101, 102, "103", 104)
|
|
||||||
sql insert into db.ctb2 values(now, 1, 2, 3)
|
|
||||||
|
|
||||||
print =============== step6: query data
|
|
||||||
sql select * from db.stb where tbname = 'ctb2';
|
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
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: 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
|
||||||
|
|
||||||
|
print =============== step2: create db
|
||||||
|
sql create database d1 vgroups 2 buffer 3
|
||||||
|
sql show databases
|
||||||
|
sql use d1
|
||||||
|
sql show vgroups
|
||||||
|
|
||||||
|
print =============== step3: create show stable
|
||||||
|
sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned)
|
||||||
|
sql show stables
|
||||||
|
if $rows != 1 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== step4: create show table
|
||||||
|
sql create table ct1 using stb tags(1000)
|
||||||
|
sql create table ct2 using stb tags(2000)
|
||||||
|
sql create table ct3 using stb tags(3000)
|
||||||
|
sql show tables
|
||||||
|
if $rows != 3 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print =============== step5: insert data (null / update)
|
||||||
|
sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
|
||||||
|
sql insert into ct1 values(now+1s, 11, 2.1, NULL)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
|
||||||
|
sql insert into ct2 values(now+0s, 10, 2.0, 3.0)
|
||||||
|
sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, -12, -2.2, -3.2)(now+3s, -13, -2.3, -3.3)
|
||||||
|
sql insert into ct3 values('2021-01-01 00:00:00.000', NULL, NULL, 3.0)
|
||||||
|
sql insert into ct3 values('2022-03-02 16:59:00.010', 3 , 4, 5), ('2022-03-02 16:59:00.010', 33 , 4, 5), ('2022-04-01 16:59:00.011', 4, 4, 5), ('2022-04-01 16:59:00.011', 6, 4, 5), ('2022-03-06 16:59:00.013', 8, 4, 5);
|
||||||
|
sql insert into ct3 values('2022-03-02 16:59:00.010', 103, 1, 2), ('2022-03-02 16:59:00.010', 303, 3, 4), ('2022-04-01 16:59:00.011', 40, 5, 6), ('2022-04-01 16:59:00.011', 60, 4, 5), ('2022-03-06 16:59:00.013', 80, 4, 5);
|
||||||
|
|
||||||
|
print =============== step6: query data=
|
||||||
|
|
||||||
|
sql select * from stb where t1 between 1000 and 2500
|
||||||
|
|
||||||
|
|
||||||
|
_OVER:
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
print =============== check
|
||||||
|
$null=
|
||||||
|
|
||||||
|
system_content sh/checkValgrind.sh -n dnode1
|
||||||
|
print cmd return result ----> [ $system_content ]
|
||||||
|
if $system_content > 0 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $system_content == $null then
|
||||||
|
return -1
|
||||||
|
endi
|
|
@ -37,6 +37,7 @@ sql show stables
|
||||||
if $rows != 4 then
|
if $rows != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
sql show stables like 'stb'
|
||||||
|
|
||||||
print =============== step4: ccreate child table
|
print =============== step4: ccreate child table
|
||||||
sql create table c1 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
|
sql create table c1 using stb tags(true, -1, -2, -3, -4, -6.0, -7.0, 'child tbl 1', 'child tbl 1', '2022-02-25 18:00:00.000', 10, 20, 30, 40)
|
||||||
|
|
|
@ -105,6 +105,39 @@ sql insert into db.ctb2 values(now, 1, 2, 3)
|
||||||
print =============== step6: query data
|
print =============== step6: query data
|
||||||
sql select * from db.stb where tbname = 'ctb2';
|
sql select * from db.stb where tbname = 'ctb2';
|
||||||
|
|
||||||
|
|
||||||
|
print =============== step7: normal table
|
||||||
|
sql create database d1 replica 1 duration 7 keep 50
|
||||||
|
sql use d1
|
||||||
|
sql create table tb (ts timestamp, a int)
|
||||||
|
sql insert into tb values(now-28d, -28)
|
||||||
|
sql alter table tb add column b smallint
|
||||||
|
sql insert into tb values(now-25d, -25, 0)
|
||||||
|
sql alter table tb add column c tinyint
|
||||||
|
sql insert into tb values(now-22d, -22, 3, 0)
|
||||||
|
sql alter table tb add column d int
|
||||||
|
sql insert into tb values(now-19d, -19, 6, 0, 0)
|
||||||
|
sql alter table tb add column e bigint
|
||||||
|
sql insert into tb values(now-16d, -16, 9, 0, 0, 0)
|
||||||
|
sql alter table tb add column f float
|
||||||
|
sql insert into tb values(now-13d, -13, 12, 0, 0, 0, 0)
|
||||||
|
sql alter table tb add column g double
|
||||||
|
sql insert into tb values(now-10d, -10, 15, 0, 0, 0, 0, 0)
|
||||||
|
sql alter table tb add column h binary(10)
|
||||||
|
sql insert into tb values(now-7d, -7, 18, 0, 0, 0, 0, 0, '0')
|
||||||
|
sql select count(a), count(b), count(c), count(d), count(e), count(f), count(g), count(h) from d1.tb;
|
||||||
|
sql alter table tb drop column a
|
||||||
|
sql insert into tb values(now-4d, 1, 1, 1, 1, 1, 1, '1')
|
||||||
|
sql alter table tb drop column b
|
||||||
|
sql insert into tb values(now-3d, 1, 1, 1, 1, 1, '1')
|
||||||
|
sql alter table tb drop column c
|
||||||
|
sql insert into tb values(now-2d, 1, 1, 1, 1, '1')
|
||||||
|
sql alter table tb drop column d
|
||||||
|
sql insert into tb values(now-1d, 1, 1, 1, '1')
|
||||||
|
sql alter table tb drop column e
|
||||||
|
sql insert into tb values(now, 1, 1, '1')
|
||||||
|
sql select count(h) from tb
|
||||||
|
|
||||||
_OVER:
|
_OVER:
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
print =============== check
|
print =============== check
|
||||||
|
|
|
@ -0,0 +1,75 @@
|
||||||
|
system sh/stop_dnodes.sh
|
||||||
|
system sh/deploy.sh -n dnode1 -i 1
|
||||||
|
system sh/exec.sh -n dnode1 -s start -v
|
||||||
|
sql connect
|
||||||
|
|
||||||
|
print ======================== create stable
|
||||||
|
sql create database d1
|
||||||
|
sql use d1
|
||||||
|
|
||||||
|
$x = 0
|
||||||
|
while $x < 128
|
||||||
|
$tb = d1.s . $x
|
||||||
|
sql create table $tb (ts timestamp, i int) tags (j int)
|
||||||
|
$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
|
||||||
|
if $rows != 1 then
|
||||||
|
print expect 1, actual: $rows
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
$m = $m + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
|
||||||
|
print ======================== show stables
|
||||||
|
|
||||||
|
sql show d1.stables
|
||||||
|
|
||||||
|
print num of stables is $rows
|
||||||
|
if $rows != 128 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
print ======================== create table
|
||||||
|
|
||||||
|
$x = 0
|
||||||
|
while $x < 424
|
||||||
|
$tb = d1.t . $x
|
||||||
|
sql create table $tb using d1.s0 tags( $x )
|
||||||
|
$x = $x + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
print ======================== show stables
|
||||||
|
|
||||||
|
sql show d1.tables
|
||||||
|
|
||||||
|
print num of tables is $rows
|
||||||
|
if $rows != 424 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
|
||||||
|
_OVER:
|
||||||
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
print =============== check
|
||||||
|
$null=
|
||||||
|
|
||||||
|
system_content sh/checkValgrind.sh -n dnode1
|
||||||
|
print cmd return result ----> [ $system_content ]
|
||||||
|
if $system_content > 2 then
|
||||||
|
return -1
|
||||||
|
endi
|
||||||
|
|
||||||
|
if $system_content == $null then
|
||||||
|
return -1
|
||||||
|
endi
|
Loading…
Reference in New Issue