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
Shengliang Guan 已提交
4
system sh/cfg.sh -n dnode1 -c wallevel -v 2
5
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
S
Shengliang Guan 已提交
6
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 4
S
slguan 已提交
7 8 9

print ========= start dnode1 as master
system sh/exec.sh -n dnode1 -s start
H
Haojun Liao 已提交
10
sleep 2000
S
slguan 已提交
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
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

S
Shengliang Guan 已提交
44
sql import into tb values(now-29d, -29, 0)
S
slguan 已提交
45
sql select count(b) from tb
S
Shengliang Guan 已提交
46
if $data00 != 6 then
S
slguan 已提交
47 48
  return -1
endi
guanshengliang's avatar
scripts  
guanshengliang 已提交
49 50

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