homework-jianmu/tests/script/tsim/cache/restart_table.sim

48 lines
1.0 KiB
Plaintext

system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
print ======================== dnode1 start
$i = 0
$dbPrefix = ca_rt_db
$tbPrefix = ca_rt_tb
$mtPrefix = ca_rt_mt
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed bool)
sql insert into $tb values (now, 1)
sql select * from $tb
print ===>rows $rows, data $data01
if $rows != 1 then
return -1
endi
if $data01 != 1 then
return -1
endi
print =============== step2
system sh/exec.sh -n dnode1 -s stop
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
print =============== step3
sql reset query cache
print =============== step4
sql create database $db
sql use $db
sql create table $tb (ts timestamp, speed int)
sql insert into $tb values (now, 1)
sql select * from $tb
print ===>rows $rows, data $data01
if $data01 != 1 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT