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

system sh/deploy.sh -n dnode1 -i 1
S
slguan 已提交
4

S
scripts  
slguan 已提交
5
system sh/cfg.sh -n dnode1 -c wallevel -v 0
S
slguan 已提交
6
system sh/cfg.sh -n dnode1 -c numOfMPeers -v 1
S
Shengliang Guan 已提交
7
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
S
slguan 已提交
8 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 36 37 38 39 40 41 42 43 44 45 46 47 48 49

print ========= start dnode1 as master
system sh/exec.sh -n dnode1 -s start
sleep 3000
sql connect

print ======== step1 
sql create database d1 replica 1 days 7 keep 50
sql use d1
sql create table tb (ts timestamp, a int)
sql insert into tb values(now-30d, -28)
sql insert into tb values(now-27d, -27)
sql insert into tb values(now-26d, -26)
sql select count(a) from tb
if $data00 != 3 then
  return -1
endi

print ======== step2
#sql alter table tb(ts timestamp, a int, b smallint)
sql alter table tb add column b smallint
sql insert into tb values(now-25d, -25, 0)
sql insert into tb values(now-22d, -24, 1)
sql insert into tb values(now-20d, -23, 2)
sql select count(b) from tb
if $data00 != 3 then
  return -1
endi

print ========= step3
sql import into tb values(now-23d, -23, 0)
sql import into tb values(now-21d, -21, 0)
sql select count(b) from tb
if $data00 != 5 then
  return -1
endi

sql_error import into tb values(now-29d, -29, 0)
sql select count(b) from tb
if $data00 != 5 then
  return -1
endi
guanshengliang's avatar
scripts  
guanshengliang 已提交
50 51

system sh/exec.sh -n dnode1 -s stop -x SIGINT