alter_tables_v1.sim 9.2 KB
Newer Older
1 2 3 4 5 6 7 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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 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 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 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 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wallevel -v 0
system sh/cfg.sh -n dnode1 -c maxVgroupsPerDb -v 1
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 10

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

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

sql create database db
sql create table db.st (ts timestamp, i int) tags(t int)
sql create table db.t0 using db.st tags(0)
sql create table db.t1 using db.st tags(1)
sql create table db.t2 using db.st tags(2)
sql create table db.t3 using db.st tags(3)
sql create table db.t4 using db.st tags(4)
sql create table db.t5 using db.st tags(5)
sql create table db.t6 using db.st tags(6)
sql create table db.t7 using db.st tags(7)
sql create table db.t8 using db.st tags(8)
sql create table db.t9 using db.st tags(9)

sql show db.tables
if $rows != 10 then 
  return -1
endi

sql insert into db.t0 values(now, 1)
sql insert into db.t1 values(now, 1)
sql insert into db.t2 values(now, 1)
sql insert into db.t3 values(now, 1)
sql insert into db.t4 values(now, 1)
sql insert into db.t5 values(now, 1)
sql insert into db.t6 values(now, 1)
sql insert into db.t7 values(now, 1)
sql insert into db.t8 values(now, 1)
sql insert into db.t9 values(now, 1)

print ============================ step2
sql_error create table db.t10 using db.st tags(10)
sql show db.tables
if $rows != 10 then 
  return -1
endi

print ============================ step3

system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 20
system sh/exec.sh -n dnode1 -s start
$x = 0
step2: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi

sql show mnodes -x step2
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
  goto step2
endi

sql create table db.t10 using db.st tags(0)
sql create table db.t11 using db.st tags(1)
sql create table db.t12 using db.st tags(2)
sql create table db.t13 using db.st tags(3)
sql create table db.t14 using db.st tags(4)
sql create table db.t15 using db.st tags(5)
sql create table db.t16 using db.st tags(6)
sql create table db.t17 using db.st tags(7)
sql create table db.t18 using db.st tags(8)
sql create table db.t19 using db.st tags(9)
sql show db.tables
if $rows != 20 then 
  return -1
endi

sql insert into db.t10 values(now, 1)
sql insert into db.t11 values(now, 1)
sql insert into db.t12 values(now, 1)
sql insert into db.t13 values(now, 1)
sql insert into db.t14 values(now, 1)
sql insert into db.t15 values(now, 1)
sql insert into db.t16 values(now, 1)
sql insert into db.t17 values(now, 1)
sql insert into db.t18 values(now, 1)
sql insert into db.t19 values(now, 1)

print ============================ step4
sql_error create table db.t20 using db.st tags(10)
sql show db.tables
if $rows != 20 then 
  return -1
endi

print ============================ step5
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 30
system sh/exec.sh -n dnode1 -s start
$x = 0
step5: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi

sql show mnodes -x step5
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
  goto step5
endi

sql create table db.t20 using db.st tags(0)
sql create table db.t21 using db.st tags(1)
sql create table db.t22 using db.st tags(2)
sql create table db.t23 using db.st tags(3)
sql create table db.t24 using db.st tags(4)
sql create table db.t25 using db.st tags(5)
sql create table db.t26 using db.st tags(6)
sql create table db.t27 using db.st tags(7)
sql create table db.t28 using db.st tags(8)
sql create table db.t29 using db.st tags(9)
sql show db.tables
if $rows != 30 then 
  return -1
endi

sql insert into db.t20 values(now, 1)
sql insert into db.t21 values(now, 1)
sql insert into db.t22 values(now, 1)
sql insert into db.t23 values(now, 1)
sql insert into db.t24 values(now, 1)
sql insert into db.t25 values(now, 1)
sql insert into db.t26 values(now, 1)
sql insert into db.t27 values(now, 1)
sql insert into db.t28 values(now, 1)
sql insert into db.t29 values(now, 1)

print ============================ step6

sql reset query cache
sleep 100

sql select * from db.t0
if $rows != 1 then 
  return -1
endi

sql select * from db.t10
if $rows != 1 then 
  return -1
endi

sql select * from db.t20
if $rows != 1 then 
  return -1
endi

sql select * from db.st
if $rows != 30 then 
  return -1
endi

print ============================ step7
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$x = 0
step7: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi

sql show mnodes -x step7
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
  goto step7
endi

sql reset query cache
sleep 1000

sql show db.tables
if $rows != 30 then 
  return -1
endi

sql select * from db.t0
if $rows != 1 then 
  return -1
endi

sql select * from db.t10
if $rows != 1 then 
  return -1
endi

sql select * from db.t20
if $rows != 1 then 
  return -1
endi

sql select * from db.st
if $rows != 30 then 
  return -1
endi

print ============================ step8
sql_error create table db.t30 using db.st tags(10)
sql show db.tables
if $rows != 30 then 
  return -1
endi

print ============================ step9
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 40
system sh/exec.sh -n dnode1 -s start
$x = 0
step9: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi

sql show mnodes -x step9
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
  goto step9
endi

sql create table db.t30 using db.st tags(0)
sql create table db.t31 using db.st tags(1)
sql create table db.t32 using db.st tags(2)
sql create table db.t33 using db.st tags(3)
sql create table db.t34 using db.st tags(4)
sql create table db.t35 using db.st tags(5)
sql create table db.t36 using db.st tags(6)
sql create table db.t37 using db.st tags(7)
sql create table db.t38 using db.st tags(8)
sql create table db.t39 using db.st tags(9)

sql insert into db.t30 values(now, 1)
sql insert into db.t31 values(now, 1)
sql insert into db.t32 values(now, 1)
sql insert into db.t33 values(now, 1)
sql insert into db.t34 values(now, 1)
sql insert into db.t35 values(now, 1)
sql insert into db.t36 values(now, 1)
sql insert into db.t37 values(now, 1)
sql insert into db.t38 values(now, 1)
sql insert into db.t39 values(now, 1)

sql show db.tables
if $rows != 40 then 
  return -1
endi

sql reset query cache
sleep 1000

sql select * from db.t0
if $rows != 1 then 
  return -1
endi

sql select * from db.t10
if $rows != 1 then 
  return -1
endi

sql select * from db.t20
if $rows != 1 then 
  return -1
endi

sql select * from db.t30
if $rows != 1 then 
  return -1
endi

sql select * from db.st
if $rows != 40 then 
  return -1
endi

print ============================ step10
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
$x = 0
step10: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi

sql show mnodes -x step10
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
  goto step10
endi

sql reset query cache
sleep 1000

sql show db.tables
if $rows != 40 then 
  return -1
endi

sql select * from db.t0
if $rows != 1 then 
  return -1
endi

sql select * from db.t10
if $rows != 1 then 
  return -1
endi

sql select * from db.t20
if $rows != 1 then 
  return -1
endi

sql select * from db.st
if $rows != 40 then 
  return -1
endi

print ============================ step11
sql_error create table db.t40 using db.st tags(10)
sql show db.tables
if $rows != 40 then 
  return -1
endi

print ============================ step12
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 50
system sh/exec.sh -n dnode1 -s start
$x = 0
step12: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi

sql show mnodes -x step12
print mnode1 $data2_1
print mnode1 $data2_2
print mnode1 $data2_3
if $data2_1 != master then
  goto step12
endi

sql create table db.t40 using db.st tags(0)
sql create table db.t41 using db.st tags(1)
sql create table db.t42 using db.st tags(2)
sql create table db.t43 using db.st tags(3)
sql create table db.t44 using db.st tags(4)
sql create table db.t45 using db.st tags(5)
sql create table db.t46 using db.st tags(6)
sql create table db.t47 using db.st tags(7)
sql create table db.t48 using db.st tags(8)
sql create table db.t49 using db.st tags(9)

sql insert into db.t40 values(now, 1)
sql insert into db.t41 values(now, 1)
sql insert into db.t42 values(now, 1)
sql insert into db.t43 values(now, 1)
sql insert into db.t44 values(now, 1)
sql insert into db.t45 values(now, 1)
sql insert into db.t46 values(now, 1)
sql insert into db.t47 values(now, 1)
sql insert into db.t48 values(now, 1)
sql insert into db.t49 values(now, 1)

sql show db.tables
if $rows != 50 then 
  return -1
endi

sql reset query cache
sleep 1000

sql select * from db.t0
if $rows != 1 then 
  return -1
endi

sql select * from db.t10
if $rows != 1 then 
  return -1
endi

sql select * from db.t20
if $rows != 1 then 
  return -1
endi

sql select * from db.t30
if $rows != 1 then 
  return -1
endi

sql select * from db.t40
if $rows != 1 then 
  return -1
endi

sql select * from db.st
if $rows != 50 then 
  return -1
endi

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