alter_tables_v4.sim 13.3 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 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529
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 4
system sh/cfg.sh -n dnode1 -c maxTablesPerVnode -v 5

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.t000 using db.st tags(0)
sql create table db.t001 using db.st tags(1)
sql create table db.t002 using db.st tags(2)
sql create table db.t003 using db.st tags(3)
sql create table db.t004 using db.st tags(4)
sql create table db.t005 using db.st tags(5)
sql create table db.t006 using db.st tags(6)
sql create table db.t007 using db.st tags(7)
sql create table db.t008 using db.st tags(8)
sql create table db.t009 using db.st tags(9)
sql create table db.t010 using db.st tags(0)
sql create table db.t011 using db.st tags(1)
sql create table db.t012 using db.st tags(2)
sql create table db.t013 using db.st tags(3)
sql create table db.t014 using db.st tags(4)
sql create table db.t015 using db.st tags(5)
sql create table db.t016 using db.st tags(6)
sql create table db.t017 using db.st tags(7)
sql create table db.t018 using db.st tags(8)
sql create table db.t019 using db.st tags(9)

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

sql insert into db.t000 values(now, 1)
sql insert into db.t001 values(now, 1)
sql insert into db.t002 values(now, 1)
sql insert into db.t003 values(now, 1)
sql insert into db.t004 values(now, 1)
sql insert into db.t005 values(now, 1)
sql insert into db.t006 values(now, 1)
sql insert into db.t007 values(now, 1)
sql insert into db.t008 values(now, 1)
sql insert into db.t009 values(now, 1)
sql insert into db.t010 values(now, 1)
sql insert into db.t011 values(now, 1)
sql insert into db.t012 values(now, 1)
sql insert into db.t013 values(now, 1)
sql insert into db.t014 values(now, 1)
sql insert into db.t015 values(now, 1)
sql insert into db.t016 values(now, 1)
sql insert into db.t017 values(now, 1)
sql insert into db.t018 values(now, 1)
sql insert into db.t019 values(now, 1)

print ============================ step2
sql_error create table db.t100 using db.st tags(10)
sql show db.tables
if $rows != 20 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 10
system sh/exec.sh -n dnode1 -s start
$x = 0
step3: 
	$x = $x + 1
	sleep 1000
	if $x == 10 then
		return -1
	endi

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

sql create table db.t100 using db.st tags(0)
sql create table db.t101 using db.st tags(1)
sql create table db.t102 using db.st tags(2)
sql create table db.t103 using db.st tags(3)
sql create table db.t104 using db.st tags(4)
sql create table db.t105 using db.st tags(5)
sql create table db.t106 using db.st tags(6)
sql create table db.t107 using db.st tags(7)
sql create table db.t108 using db.st tags(8)
sql create table db.t109 using db.st tags(9)
sql create table db.t110 using db.st tags(0)
sql create table db.t111 using db.st tags(1)
sql create table db.t112 using db.st tags(2)
sql create table db.t113 using db.st tags(3)
sql create table db.t114 using db.st tags(4)
sql create table db.t115 using db.st tags(5)
sql create table db.t116 using db.st tags(6)
sql create table db.t117 using db.st tags(7)
sql create table db.t118 using db.st tags(8)
sql create table db.t119 using db.st tags(9)
sql show db.tables
if $rows != 40 then 
  return -1
endi


sql insert into db.t100 values(now, 1)
sql insert into db.t101 values(now, 1)
sql insert into db.t102 values(now, 1)
sql insert into db.t103 values(now, 1)
sql insert into db.t104 values(now, 1)
sql insert into db.t105 values(now, 1)
sql insert into db.t106 values(now, 1)
sql insert into db.t107 values(now, 1)
sql insert into db.t108 values(now, 1)
sql insert into db.t109 values(now, 1)
sql insert into db.t110 values(now, 1)
sql insert into db.t111 values(now, 1)
sql insert into db.t112 values(now, 1)
sql insert into db.t113 values(now, 1)
sql insert into db.t114 values(now, 1)
sql insert into db.t115 values(now, 1)
sql insert into db.t116 values(now, 1)
sql insert into db.t117 values(now, 1)
sql insert into db.t118 values(now, 1)
sql insert into db.t119 values(now, 1)

print ============================ step4
sql_error create table db.t200 using db.st tags(10)
sql show db.tables
if $rows != 40 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 15
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.t200 using db.st tags(0)
sql create table db.t201 using db.st tags(1)
sql create table db.t202 using db.st tags(2)
sql create table db.t203 using db.st tags(3)
sql create table db.t204 using db.st tags(4)
sql create table db.t205 using db.st tags(5)
sql create table db.t206 using db.st tags(6)
sql create table db.t207 using db.st tags(7)
sql create table db.t208 using db.st tags(8)
sql create table db.t209 using db.st tags(9)
sql create table db.t210 using db.st tags(0)
sql create table db.t211 using db.st tags(1)
sql create table db.t212 using db.st tags(2)
sql create table db.t213 using db.st tags(3)
sql create table db.t214 using db.st tags(4)
sql create table db.t215 using db.st tags(5)
sql create table db.t216 using db.st tags(6)
sql create table db.t217 using db.st tags(7)
sql create table db.t218 using db.st tags(8)
sql create table db.t219 using db.st tags(9)
sql show db.tables
if $rows != 60 then 
  return -1
endi

sql insert into db.t200 values(now, 1)
sql insert into db.t201 values(now, 1)
sql insert into db.t202 values(now, 1)
sql insert into db.t203 values(now, 1)
sql insert into db.t204 values(now, 1)
sql insert into db.t205 values(now, 1)
sql insert into db.t206 values(now, 1)
sql insert into db.t207 values(now, 1)
sql insert into db.t208 values(now, 1)
sql insert into db.t209 values(now, 1)
sql insert into db.t210 values(now, 1)
sql insert into db.t211 values(now, 1)
sql insert into db.t212 values(now, 1)
sql insert into db.t213 values(now, 1)
sql insert into db.t214 values(now, 1)
sql insert into db.t215 values(now, 1)
sql insert into db.t216 values(now, 1)
sql insert into db.t217 values(now, 1)
sql insert into db.t218 values(now, 1)
sql insert into db.t219 values(now, 1)

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

sql reset query cache
sleep 100

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

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

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

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

print ============================ step7
system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 3000
system sh/exec.sh -n dnode1 -s start
sleep 3000

sql reset query cache
sleep 1000

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

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

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

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

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

print ============================ step8
sql_error create table db.t300 using db.st tags(10)
sql show db.tables
if $rows != 60 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 20
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.t300 using db.st tags(0)
sql create table db.t301 using db.st tags(1)
sql create table db.t302 using db.st tags(2)
sql create table db.t303 using db.st tags(3)
sql create table db.t304 using db.st tags(4)
sql create table db.t305 using db.st tags(5)
sql create table db.t306 using db.st tags(6)
sql create table db.t307 using db.st tags(7)
sql create table db.t308 using db.st tags(8)
sql create table db.t309 using db.st tags(9)
sql create table db.t310 using db.st tags(0)
sql create table db.t311 using db.st tags(1)
sql create table db.t312 using db.st tags(2)
sql create table db.t313 using db.st tags(3)
sql create table db.t314 using db.st tags(4)
sql create table db.t315 using db.st tags(5)
sql create table db.t316 using db.st tags(6)
sql create table db.t317 using db.st tags(7)
sql create table db.t318 using db.st tags(8)
sql create table db.t319 using db.st tags(9)

sql insert into db.t300 values(now, 1)
sql insert into db.t301 values(now, 1)
sql insert into db.t302 values(now, 1)
sql insert into db.t303 values(now, 1)
sql insert into db.t304 values(now, 1)
sql insert into db.t305 values(now, 1)
sql insert into db.t306 values(now, 1)
sql insert into db.t307 values(now, 1)
sql insert into db.t308 values(now, 1)
sql insert into db.t309 values(now, 1)
sql insert into db.t310 values(now, 1)
sql insert into db.t311 values(now, 1)
sql insert into db.t312 values(now, 1)
sql insert into db.t313 values(now, 1)
sql insert into db.t314 values(now, 1)
sql insert into db.t315 values(now, 1)
sql insert into db.t316 values(now, 1)
sql insert into db.t317 values(now, 1)
sql insert into db.t318 values(now, 1)
sql insert into db.t319 values(now, 1)

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

sql reset query cache
sleep 1000

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

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

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

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

sql select * from db.st
if $rows != 80 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 != 80 then 
  return -1
endi

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

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

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

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

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

print ============================ step11
sql_error create table db.t400 using db.st tags(10)
sql show db.tables
if $rows != 80 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 25
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.t400 using db.st tags(0)
sql create table db.t401 using db.st tags(1)
sql create table db.t402 using db.st tags(2)
sql create table db.t403 using db.st tags(3)
sql create table db.t404 using db.st tags(4)
sql create table db.t405 using db.st tags(5)
sql create table db.t406 using db.st tags(6)
sql create table db.t407 using db.st tags(7)
sql create table db.t408 using db.st tags(8)
sql create table db.t409 using db.st tags(9)
sql create table db.t410 using db.st tags(0)
sql create table db.t411 using db.st tags(1)
sql create table db.t412 using db.st tags(2)
sql create table db.t413 using db.st tags(3)
sql create table db.t414 using db.st tags(4)
sql create table db.t415 using db.st tags(5)
sql create table db.t416 using db.st tags(6)
sql create table db.t417 using db.st tags(7)
sql create table db.t418 using db.st tags(8)
sql create table db.t419 using db.st tags(9)

sql insert into db.t400 values(now, 1)
sql insert into db.t401 values(now, 1)
sql insert into db.t402 values(now, 1)
sql insert into db.t403 values(now, 1)
sql insert into db.t404 values(now, 1)
sql insert into db.t405 values(now, 1)
sql insert into db.t406 values(now, 1)
sql insert into db.t407 values(now, 1)
sql insert into db.t408 values(now, 1)
sql insert into db.t409 values(now, 1)
sql insert into db.t410 values(now, 1)
sql insert into db.t411 values(now, 1)
sql insert into db.t412 values(now, 1)
sql insert into db.t413 values(now, 1)
sql insert into db.t414 values(now, 1)
sql insert into db.t415 values(now, 1)
sql insert into db.t416 values(now, 1)
sql insert into db.t417 values(now, 1)
sql insert into db.t418 values(now, 1)
sql insert into db.t419 values(now, 1)

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

sql reset query cache
sleep 1000

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

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

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

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

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

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

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