restart_table.sim 1.2 KB
Newer Older
S
slguan 已提交
1 2
system sh/stop_dnodes.sh

S
slguan 已提交
3 4

system sh/deploy.sh -n dnode1 -i 1
H
hjxilinx 已提交
5
system sh/cfg.sh -n dnode1 -c walLevel -v 0
S
slguan 已提交
6 7
system sh/exec.sh -n dnode1 -s start

H
Haojun Liao 已提交
8
sleep 2000
S
slguan 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
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
H
Haojun Liao 已提交
36
sleep 3000
S
slguan 已提交
37
system sh/deploy.sh -n dnode1 -i 1
H
hjxilinx 已提交
38
system sh/cfg.sh -n dnode1 -c walLevel -v 0
S
slguan 已提交
39 40 41 42
system sh/exec.sh -n dnode1 -s start

print =============== step3
print ==> sleep 8 seconds to renew cache
H
Haojun Liao 已提交
43
sleep 2000
S
slguan 已提交
44 45 46 47 48 49 50 51 52 53 54 55 56 57
sql reset query cache
sleep 18000

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  

guanshengliang's avatar
scripts  
guanshengliang 已提交
58
system sh/exec.sh -n dnode1 -s stop -x SIGINT