2020-04-19 15:28:22 +00:00
system sh/stop_dnodes.sh
2020-04-29 09:30:03 +00:00
system sh/deploy.sh -n dnode1 -i 1
2021-03-08 03:57:33 +00:00
system sh/cfg.sh -n dnode1 -c walLevel -v 1
2020-04-19 15:28:22 +00:00
system sh/exec.sh -n dnode1 -s start
2021-01-20 05:43:54 +00:00
sleep 2000
2020-04-19 15:28:22 +00:00
sql connect
print ======================== dnode1 start
2020-05-08 07:15:23 +00:00
$dbPrefix = db
$tbPrefix = tb
$mtPrefix = st
2020-04-19 15:28:22 +00:00
$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
2021-08-03 03:46:41 +00:00
sql insert into $tb values (1626739200000 + $ms , '0' )
2020-04-19 15:28:22 +00:00
$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
2021-08-03 03:46:41 +00:00
sql insert into $tb values (1626739200000 + $ms , '1' )
2020-04-19 15:28:22 +00:00
$x = $x + 1
endw
$i = $i + 1
endw
print =============== step2
sql select * from $mt where tbcol = '0'
if $rows != 100 then
return -1
endi
2021-08-03 03:46:41 +00:00
sql select * from $mt where ts > 1626739440001 and tbcol = '1'
2020-04-19 15:28:22 +00:00
if $rows != 75 then
return -1
endi
2020-06-02 08:06:45 +00:00
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
2021-08-03 03:46:41 +00:00
sql_error select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1626739440001 and tbcol = '1' group by tgcol
2020-06-02 08:06:45 +00:00
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
2020-04-19 15:28:22 +00:00
#can't filter binary fields
print =============== clear
sql drop database $db
sql show databases
if $rows != 0 then
return -1
2020-05-08 07:15:23 +00:00
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT