test: valgrind case
This commit is contained in:
parent
12ab7a2d77
commit
f76b7ce165
|
@ -0,0 +1,77 @@
|
||||||
|
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
|
||||||
|
|
||||||
|
$tbPrefix = tb
|
||||||
|
$tbNum = 5
|
||||||
|
$rowNum = 10
|
||||||
|
|
||||||
|
print =============== step2: prepare data
|
||||||
|
sql create database db vgroups 2
|
||||||
|
sql use db
|
||||||
|
sql create table if not exists stb (ts timestamp, tbcol int, tbcol2 float, tbcol3 double) tags (tgcol int unsigned)
|
||||||
|
|
||||||
|
$i = 0
|
||||||
|
while $i < $tbNum
|
||||||
|
$tb = $tbPrefix . $i
|
||||||
|
sql create table $tb using stb tags( $i )
|
||||||
|
$x = 0
|
||||||
|
while $x < $rowNum
|
||||||
|
$cc = $x * 60000
|
||||||
|
$ms = 1601481600000 + $cc
|
||||||
|
sql insert into $tb values ($ms , $x , $x , $x )
|
||||||
|
$x = $x + 1
|
||||||
|
endw
|
||||||
|
$i = $i + 1
|
||||||
|
endw
|
||||||
|
|
||||||
|
print =============== step3: avg
|
||||||
|
sql select avg(tbcol) from tb1
|
||||||
|
sql select avg(tbcol) from tb1 where ts <= 1601481840000
|
||||||
|
sql select avg(tbcol) as b from tb1
|
||||||
|
sql select avg(tbcol) as b from tb1 interval(1d)
|
||||||
|
goto _OVER
|
||||||
|
sql select avg(tbcol) as b from tb1 where ts <= 1601481840000s interval(1m)
|
||||||
|
sql select avg(tbcol) as c from stb
|
||||||
|
sql select avg(tbcol) as c from stb where ts <= 1601481840000
|
||||||
|
sql select avg(tbcol) as c from stb where tgcol < 5 and ts <= 1601481840000
|
||||||
|
sql select avg(tbcol) as c from stb interval(1m)
|
||||||
|
sql select avg(tbcol) as c from stb interval(1d)
|
||||||
|
sql select avg(tbcol) as b from stb where ts <= 1601481840000s interval(1m)
|
||||||
|
sql select avg(tbcol) as c from stb group by tgcol
|
||||||
|
sql select avg(tbcol) as b from stb where ts <= 1601481840000s partition by tgcol interval(1m)
|
||||||
|
|
||||||
|
_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
|
Loading…
Reference in New Issue