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
|
2020-05-07 06:28:39 +00:00
|
|
|
system sh/cfg.sh -n dnode1 -c walLevel -v 0
|
2020-05-07 09:14:25 +00:00
|
|
|
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2
|
2020-04-19 15:28:22 +00:00
|
|
|
system sh/exec.sh -n dnode1 -s start
|
2021-01-09 06:25:54 +00:00
|
|
|
sleep 100
|
2020-04-19 15:28:22 +00:00
|
|
|
sql connect
|
|
|
|
|
|
|
|
|
|
$dbPrefix = scd_db
|
|
|
|
|
$tbPrefix = scd_tb
|
|
|
|
|
$stbPrefix = scd_stb
|
|
|
|
|
$tbNum = 20
|
|
|
|
|
$rowNum = 10
|
|
|
|
|
$totalNum = $tbNum * $rowNum
|
|
|
|
|
$ts0 = 1537146000000
|
|
|
|
|
$delta = 600000
|
|
|
|
|
print ========== select_from_cache_disk.sim
|
|
|
|
|
$i = 0
|
|
|
|
|
$db = $dbPrefix
|
|
|
|
|
$stb = $stbPrefix
|
|
|
|
|
$tb = $tbPrefix
|
|
|
|
|
|
|
|
|
|
sql drop database if exists $db
|
|
|
|
|
sql create database $db
|
|
|
|
|
sql use $db
|
|
|
|
|
print ====== create tables
|
|
|
|
|
sql create table $stb (ts timestamp, c1 int) tags(t1 int)
|
|
|
|
|
sql create table $tb using $stb tags( 1 )
|
|
|
|
|
# generate some data on disk
|
|
|
|
|
sql insert into $tb values ('2018-09-17 09:00:00.000', 0)
|
|
|
|
|
sql insert into $tb values ('2018-09-17 09:00:00.010', 1)
|
|
|
|
|
sql insert into $tb values ('2018-09-17 09:00:00.020', 2)
|
|
|
|
|
sql insert into $tb values ('2018-09-17 09:00:00.030', 3)
|
|
|
|
|
|
|
|
|
|
print ================== restart server to commit data into disk
|
|
|
|
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
2021-01-20 05:43:54 +00:00
|
|
|
sleep 2000
|
2020-04-19 15:28:22 +00:00
|
|
|
system sh/exec.sh -n dnode1 -s start
|
|
|
|
|
print ================== server restart completed
|
|
|
|
|
sql connect
|
2021-01-09 06:25:54 +00:00
|
|
|
sleep 100
|
2020-04-19 15:28:22 +00:00
|
|
|
sql use $db
|
|
|
|
|
|
|
|
|
|
# generate some data in cache
|
|
|
|
|
sql insert into $tb values ('2018-09-17 09:00:04.000', 4)
|
|
|
|
|
sql insert into $tb values ('2018-09-17 09:00:04.010', 5)
|
|
|
|
|
sql select count(*) from $stb interval(1s) group by t1
|
|
|
|
|
if $rows != 2 then
|
|
|
|
|
return -1
|
|
|
|
|
endi
|
|
|
|
|
if $data00 != @18-09-17 09:00:00.000@ then
|
|
|
|
|
return -1
|
|
|
|
|
endi
|
|
|
|
|
if $data01 != 4 then
|
|
|
|
|
return -1
|
|
|
|
|
endi
|
|
|
|
|
if $data02 != 1 then
|
|
|
|
|
return -1
|
|
|
|
|
endi
|
|
|
|
|
if $data10 != @18-09-17 09:00:04.000@ then
|
|
|
|
|
return -1
|
|
|
|
|
endi
|
|
|
|
|
if $data11 != 2 then
|
|
|
|
|
return -1
|
|
|
|
|
endi
|
|
|
|
|
if $data12 != 1 then
|
|
|
|
|
return -1
|
|
|
|
|
endi
|
2020-05-12 10:28:00 +00:00
|
|
|
|
|
|
|
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|