alter_option.sim 5.8 KB
Newer Older
1 2 3
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
S
scripts  
Shengliang Guan 已提交
4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 1000
5 6 7

system sh/exec.sh -n dnode1 -s start

H
Haojun Liao 已提交
8
sleep 2000
9 10
sql connect

S
TD-1336  
Shengliang Guan 已提交
11
print ============= create database
S
scripts  
Shengliang Guan 已提交
12
sql create database db cache 2 blocks 4 days 10 keep 20 minRows 300 maxRows 400 ctime 120 precision 'ms' comp 2 wal 1 replica 1
13 14 15 16 17 18 19 20 21 22 23 24 25
sql show databases
if $data00 != db then 
  return -1
endi
if $data02 != 0 then 
  return -1
endi
if $data03 != 0 then 
  return -1
endi
if $data04 != 1 then 
  return -1
endi
S
scripts  
Shengliang Guan 已提交
26
if $data06 != 10 then 
27 28
  return -1
endi
S
scripts  
Shengliang Guan 已提交
29
if $data07 != 20,20,20 then 
30 31
  return -1
endi
S
scripts  
Shengliang Guan 已提交
32
if $data08 != 2 then 
33 34
  return -1
endi
S
scripts  
Shengliang Guan 已提交
35
if $data09 != 4 then 
36 37 38
  return -1
endi

S
TD-1336  
Shengliang Guan 已提交
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
print ============== step name
sql_error alter database db name d1
sql_error alter database db name d2

print ============== step ntables
sql_error alter database db ntables -1
sql_error alter database db ntables 0
sql_error alter database db ntables 1
sql_error alter database db ntables 10

print ============== step vgroups
sql_error alter database db vgroups -1
sql_error alter database db vgroups 0
sql_error alter database db vgroups 1
sql_error alter database db vgroups 10

print ============== step replica
56
sql_error alter database db replica 2
S
TD-1336  
Shengliang Guan 已提交
57 58
sql_error alter database db replica 3
sql_error alter database db replica 0
59

S
TD-1336  
Shengliang Guan 已提交
60 61 62 63 64 65
sql alter database db replica 1
sql show databases
print replica $data4_db
if $data4_db != 1 then 
  return -1
endi
66

S
TD-1336  
Shengliang Guan 已提交
67 68 69 70 71 72 73 74 75 76 77 78 79 80
print ============== step quorum
sql show databases
print quorum $data5_db
if $data5_db != 1 then 
  return -1
endi

sql alter database db quorum 1
sql show databases
print quorum $data5_db
if $data5_db != 1 then 
  return -1
endi

L
liuyq-617 已提交
81
sql_error alter database db quorum 2
S
TD-1336  
Shengliang Guan 已提交
82

L
liuyq-617 已提交
83
sql_error alter database db quorum 3
S
TD-1336  
Shengliang Guan 已提交
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104

sql_error alter database db quorum 0
sql_error alter database db quorum 4
sql_error alter database db quorum 5
sql_error alter database db quorum -1

print ============== step days
sql_error alter database db days 0
sql_error alter database db days 1
sql_error alter database db days 2
sql_error alter database db days 10
sql_error alter database db days 50
sql_error alter database db days 100

print ============== step keep
sql show databases
print keep $data7_db
if $data7_db != 20,20,20 then 
  return -1
endi

105
sql alter database db keep 20
S
TD-1336  
Shengliang Guan 已提交
106 107
sql show databases
print keep $data7_db
108
if $data7_db != 20,20,20 then
S
TD-1336  
Shengliang Guan 已提交
109 110 111
  return -1
endi

112
sql alter database db keep 30
S
TD-1336  
Shengliang Guan 已提交
113 114
sql show databases
print keep $data7_db
D
dapan 已提交
115
if $data7_db != 30,30,30 then
S
TD-1336  
Shengliang Guan 已提交
116 117 118
  return -1
endi

119
sql alter database db keep 40
S
TD-1336  
Shengliang Guan 已提交
120 121
sql show databases
print keep $data7_db
D
dapan 已提交
122
if $data7_db != 40,40,40 then
S
TD-1336  
Shengliang Guan 已提交
123 124 125
  return -1
endi

D
dapan 已提交
126 127
sql alter database db keep 40,50
sql alter database db keep 30,31
S
TD-1336  
Shengliang Guan 已提交
128
sql alter database db keep 20
D
dapan 已提交
129
sql_error alter database db keep 10.0
S
TD-1336  
Shengliang Guan 已提交
130 131
sql_error alter database db keep 9
sql_error alter database db keep 1
D
dapan1121 已提交
132 133
sql_error alter database db keep 0
sql_error alter database db keep -1
S
TD-1336  
Shengliang Guan 已提交
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
sql_error alter database db keep 365001

print ============== step cache
sql_error alter database db cache 60
sql_error alter database db cache 50
sql_error alter database db cache 20
sql_error alter database db cache 3
sql_error alter database db cache 129
sql_error alter database db cache 300
sql_error alter database db cache 0
sql_error alter database db cache -1

print ============== step blocks
sql show databases
print blocks $data9_db
if $data9_db != 4 then 
  return -1
endi

sql alter database db blocks 10
sql show databases
print blocks $data9_db
if $data9_db != 10 then 
  return -1
endi

sql alter database db blocks 20
sql show databases
print blocks $data9_db
if $data9_db != 20 then 
  return -1
endi

sql alter database db blocks 30
sql show databases
print blocks $data9_db
if $data9_db != 30 then 
  return -1
endi

sql alter database db blocks 40
sql alter database db blocks 30
sql alter database db blocks 20
sql alter database db blocks 10
sql_error alter database db blocks 2
sql_error alter database db blocks 1
X
xywang 已提交
180
sql_error alter database db blocks 0
S
TD-1336  
Shengliang Guan 已提交
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
sql_error alter database db blocks -1
sql_error alter database db blocks 10001

print ============== step minrows
sql_error alter database db minrows 1
sql_error alter database db minrows 100
sql_error alter database db minrows 1000

print ============== step maxrows
sql_error alter database db maxrows 1
sql_error alter database db maxrows 100
sql_error alter database db maxrows 1000

print ============== step wallevel
sql show databases
print wallevel $data12_db
if $data12_db != 1 then 
  return -1
endi

201 202
sql_error alter database db wal 1

S
TD-1336  
Shengliang Guan 已提交
203

204 205 206 207 208
sql_error alter database db wal 1
sql_error alter database db wal 2
sql_error alter database db wal 1
sql_error alter database db wal 2
sql_error alter database db wal 0
S
TD-1336  
Shengliang Guan 已提交
209 210 211 212 213 214
sql_error alter database db wal 3
sql_error alter database db wal 4
sql_error alter database db wal -1
sql_error alter database db wal 1000

print ============== step fsync
215 216 217 218 219
sql_error alter database db fsync 0
sql_error alter database db fsync 1
sql_error alter database db fsync 3600
sql_error alter database db fsync 18000
sql_error alter database db fsync 180000
S
TD-1388  
Shengliang Guan 已提交
220
sql_error alter database db fsync 180001
S
TD-1336  
Shengliang Guan 已提交
221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
sql_error alter database db fsync -1

print ============== step comp
sql show databases
print comp $data14_db
if $data14_db != 2 then 
  return -1
endi

sql alter database db comp 1
sql show databases
print comp $data14_db
if $data14_db != 1 then 
  return -1
endi

sql alter database db comp 2
sql show databases
print comp $data14_db
if $data14_db != 2 then 
  return -1
endi

sql alter database db comp 0
sql show databases
print comp $data14_db
if $data14_db != 0 then 
  return -1
endi

sql_error alter database db comp 3
sql_error alter database db comp 4
sql_error alter database db comp 5
sql_error alter database db comp -1

256

S
TD-1336  
Shengliang Guan 已提交
257 258
print ============== step precision
sql_error alter database db prec 'us'
259

S
TD-1336  
Shengliang Guan 已提交
260 261
print ============== step status
sql_error alter database db status 'delete'
262

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