basic.sim 3.9 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2 3 4 5
system sh/deploy.sh -n dnode1 -i 1
system sh/deploy.sh -n dnode2 -i 2
system sh/deploy.sh -n dnode3 -i 3
system sh/deploy.sh -n dnode4 -i 4
S
slguan 已提交
6

7 8 9 10
system sh/cfg.sh -n dnode1 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode2 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode3 -c numOfMnodes -v 1
system sh/cfg.sh -n dnode4 -c numOfMnodes -v 1
S
slguan 已提交
11

S
Shengliang Guan 已提交
12 13 14 15
system sh/cfg.sh -n dnode1 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode2 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode3 -c mnodeEqualVnodeNum -v 10
system sh/cfg.sh -n dnode4 -c mnodeEqualVnodeNum -v 10
S
slguan 已提交
16

S
scripts  
slguan 已提交
17 18 19 20
system sh/cfg.sh -n dnode1 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode2 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode3 -c maxtablesPerVnode -v 2000
system sh/cfg.sh -n dnode4 -c maxtablesPerVnode -v 2000
S
slguan 已提交
21

22 23 24 25
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/cfg.sh -n dnode2 -c walLevel -v 1
system sh/cfg.sh -n dnode3 -c walLevel -v 1
system sh/cfg.sh -n dnode4 -c walLevel -v 1
S
slguan 已提交
26 27 28

print ========= start dnode1
system sh/exec.sh -n dnode1 -s start
H
Haojun Liao 已提交
29
sleep 2000
S
slguan 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
sql connect

sql create database ibadb
sql use ibadb
sql create table tb(ts timestamp, i int)

print ================= step1

sql import into tb values(1564641710000, 10000)
sql select * from tb;
if $rows != 1 then 
  return -1
endi

print ================= step2
sql insert into tb values(1564641708000, 8000)
sql select * from tb;
guanshengliang's avatar
scripts  
guanshengliang 已提交
47
if $rows != 2 then 
S
slguan 已提交
48 49 50 51 52 53
  return -1
endi

print ================= step3
sql insert into tb values(1564641720000, 20000)
sql select * from tb;
guanshengliang's avatar
scripts  
guanshengliang 已提交
54
if $rows != 3 then 
S
slguan 已提交
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
  return -1
endi

print ================= step4
sql import into tb values(1564641708000, 8000)
sql import into tb values(1564641715000, 15000)
sql import into tb values(1564641730000, 30000)
sql select * from tb;
if $rows != 5 then 
  return -1
endi

print ================= step5
sql insert into tb values(1564641708000, 8000)
sql insert into tb values(1564641714000, 14000)
sql insert into tb values(1564641725000, 25000)
sql insert into tb values(1564641740000, 40000)
sql select * from tb;
guanshengliang's avatar
scripts  
guanshengliang 已提交
73
if $rows != 8 then 
S
slguan 已提交
74 75 76 77 78 79 80 81 82 83
  return -1
endi

print ================= step6
sql import into tb values(1564641707000, 7000)
sql import into tb values(1564641712000, 12000)
sql import into tb values(1564641723000, 23000)
sql import into tb values(1564641734000, 34000)
sql import into tb values(1564641750000, 50000)
sql select * from tb;
guanshengliang's avatar
scripts  
guanshengliang 已提交
84
if $rows != 13 then 
S
slguan 已提交
85 86 87 88 89 90 91 92 93 94
  return -1
endi

print ================= step7
sql import into tb values(1564641707001, 7001)
sql import into tb values(1564641712001, 12001)
sql import into tb values(1564641723001, 23001)
sql import into tb values(1564641734001, 34001)
sql import into tb values(1564641750001, 50001)
sql select * from tb;
guanshengliang's avatar
scripts  
guanshengliang 已提交
95
if $rows != 18 then 
S
slguan 已提交
96 97 98 99 100 101 102 103 104
  return -1
endi

print ================= step8
sql insert into tb values(1564641708002, 8002)
sql insert into tb values(1564641714002, 14002)
sql insert into tb values(1564641725002, 25002)
sql insert into tb values(1564641900000, 200000)
sql select * from tb;
guanshengliang's avatar
scripts  
guanshengliang 已提交
105
if $rows != 22 then 
S
slguan 已提交
106 107 108 109 110 111
  return -1
endi

print ================= step9 only insert last one
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 700000)
sql select * from tb;
guanshengliang's avatar
scripts  
guanshengliang 已提交
112
if $rows != 25 then
S
slguan 已提交
113 114 115 116 117 118
  return -1
endi

print ================= step10
sql import into tb values(1564641705000, 5000)(1564641718000, 18000)(1564642400000, 70000)
sql select * from tb;
guanshengliang's avatar
scripts  
guanshengliang 已提交
119
if $rows != 25 then
S
slguan 已提交
120 121 122 123 124 125
  return -1
endi

print ================= step11
sql import into tb values(1564642400000, 700000)
sql select * from tb;
guanshengliang's avatar
scripts  
guanshengliang 已提交
126
if $rows != 25 then
S
slguan 已提交
127 128 129 130 131 132 133
  return -1
endi

print ================= step12
sql import into tb values(1564641709527, 9527)(1564641709527, 9528)
sql select * from tb;
print rows=> $rows
guanshengliang's avatar
scripts  
guanshengliang 已提交
134
if $rows != 26 then
S
slguan 已提交
135 136 137 138 139 140 141
  return -1
endi

print ================= step13
sql import into tb values(1564641709898, 9898)(1564641709897, 9897)
sql select * from tb;
print rows=> $rows
guanshengliang's avatar
scripts  
guanshengliang 已提交
142
if $rows != 28 then
S
slguan 已提交
143 144 145
  return -1
endi

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