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 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732
|
#
# CREATE TABLESPACE related tests for 4k page sizes.
#
SET DEFAULT_STORAGE_ENGINE=InnoDB;
# Strict-mode has no effect on CREATE TABLESPACE. But it does affect
# whether an invalid KEY_BLOCK_SIZE is rejected or adjusted.
SHOW VARIABLES LIKE 'innodb_strict_mode';
Variable_name Value
innodb_strict_mode ON
SHOW VARIABLES LIKE 'innodb_file_per_table';
Variable_name Value
innodb_file_per_table ON
#
# Create a tablespace with compressed page sizes that can match
# innodb-page-size.
#
CREATE TABLESPACE s_1k ADD DATAFILE 's_1k.ibd' FILE_BLOCK_SIZE=1k;
CREATE TABLESPACE s_2k ADD DATAFILE 's_2k.ibd' FILE_BLOCK_SIZE=2k;
CREATE TABLESPACE s_4k ADD DATAFILE 's_4k.ibd' FILE_BLOCK_SIZE=4k;
CREATE TABLESPACE s_8k ADD DATAFILE 's_8k.ibd' FILE_BLOCK_SIZE=8k;
ERROR HY000: InnoDB: Cannot create a tablespace with FILE_BLOCK_SIZE=8192 because INNODB_PAGE_SIZE=4096.
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Cannot create a tablespace with FILE_BLOCK_SIZE=8192 because INNODB_PAGE_SIZE=4096.
Error 1528 Failed to create TABLESPACE s_8k
Error 1031 Table storage engine for 's_8k' doesn't have this option
CREATE TABLESPACE s_16k ADD DATAFILE 's_16k.ibd' FILE_BLOCK_SIZE=16k;
ERROR HY000: InnoDB: Cannot create a tablespace with FILE_BLOCK_SIZE=16384 because INNODB_PAGE_SIZE=4096.
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Cannot create a tablespace with FILE_BLOCK_SIZE=16384 because INNODB_PAGE_SIZE=4096.
Error 1528 Failed to create TABLESPACE s_16k
Error 1031 Table storage engine for 's_16k' doesn't have this option
CREATE TABLESPACE s_32k ADD DATAFILE 's_32k.ibd' FILE_BLOCK_SIZE=32k;
ERROR HY000: InnoDB: Cannot create a tablespace with FILE_BLOCK_SIZE=32768 because INNODB_PAGE_SIZE=4096.
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Cannot create a tablespace with FILE_BLOCK_SIZE=32768 because INNODB_PAGE_SIZE=4096.
Error 1528 Failed to create TABLESPACE s_32k
Error 1031 Table storage engine for 's_32k' doesn't have this option
CREATE TABLESPACE s_64k ADD DATAFILE 's_64k.ibd' FILE_BLOCK_SIZE=64k;
ERROR HY000: InnoDB: Cannot create a tablespace with FILE_BLOCK_SIZE=65536 because INNODB_PAGE_SIZE=4096.
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Cannot create a tablespace with FILE_BLOCK_SIZE=65536 because INNODB_PAGE_SIZE=4096.
Error 1528 Failed to create TABLESPACE s_64k
Error 1031 Table storage engine for 's_64k' doesn't have this option
=== information_schema.innodb_tablespaces and innodb_datafiles ===
Space_Name Space_Type Page_Size Zip_Size BlockSize!=0 FileSize!=0 Formats_Permitted Path
mtr/asserted_test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k General DEFAULT 1024 1 1 Compressed s_1k.ibd
s_2k General DEFAULT 2048 1 1 Compressed s_2k.ibd
s_4k General DEFAULT 0 1 1 Any s_4k.ibd
=== information_schema.files ===
Space_Name File_Type Engine Status Tablespace_Name Path
mtr/asserted_test_suppressions TABLESPACE InnoDB NORMAL mtr/asserted_test_suppressions MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions TABLESPACE InnoDB NORMAL mtr/global_suppressions MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions TABLESPACE InnoDB NORMAL mtr/test_ignored_global_suppressions MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions TABLESPACE InnoDB NORMAL mtr/test_suppressions MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k TABLESPACE InnoDB NORMAL s_1k MYSQLD_DATADIR/s_1k.ibd
s_2k TABLESPACE InnoDB NORMAL s_2k MYSQLD_DATADIR/s_2k.ibd
s_4k TABLESPACE InnoDB NORMAL s_4k MYSQLD_DATADIR/s_4k.ibd
#
# Try to put a temporary table into a non-temporary compressed tablespace
#
CREATE TEMPORARY TABLE t_temp_zip (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=1 TABLESPACE s_1k;
ERROR HY000: InnoDB: Tablespace `s_1k` cannot contain TEMPORARY tables.
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` cannot contain TEMPORARY tables.
Error 1031 Table storage engine for 't_temp_zip' doesn't have this option
#
# Add tables to the 1K tablespace.
#
CREATE TABLE t_zip1k_in_1k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=1 TABLESPACE s_1k;
CREATE TABLE t_zip2k_in_1k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=2 TABLESPACE s_1k;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 2048
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 2048
Error 1031 Table storage engine for 't_zip2k_in_1k' doesn't have this option
CREATE TABLE t_zip4k_in_1k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=4 TABLESPACE s_1k;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
Error 1031 Table storage engine for 't_zip4k_in_1k' doesn't have this option
CREATE TABLE t_zip8k_in_1k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=8 TABLESPACE s_1k;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 8192
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 8192
Error 1031 Table storage engine for 't_zip8k_in_1k' doesn't have this option
CREATE TABLE t_zip16k_in_1k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=16 TABLESPACE s_1k;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 16384
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 16384
Error 1031 Table storage engine for 't_zip16k_in_1k' doesn't have this option
CREATE TABLE t_zip32k_in_1k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=32 TABLESPACE s_1k;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 32768
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 32768
Error 1031 Table storage engine for 't_zip32k_in_1k' doesn't have this option
CREATE TABLE t_red_in_1k (a int, b text) ROW_FORMAT=Redundant TABLESPACE s_1k;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
Error 1031 Table storage engine for 't_red_in_1k' doesn't have this option
CREATE TABLE t_cmp_in_1k (a int, b text) ROW_FORMAT=Compact TABLESPACE s_1k;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
Error 1031 Table storage engine for 't_cmp_in_1k' doesn't have this option
CREATE TABLE t_dyn_in_1k (a int, b text) ROW_FORMAT=Dynamic TABLESPACE s_1k;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
Error 1031 Table storage engine for 't_dyn_in_1k' doesn't have this option
#
# Add tables to the 2K tablespace.
#
CREATE TABLE t_zip1k_in_2k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=1 TABLESPACE s_2k;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 1024
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 1024
Error 1031 Table storage engine for 't_zip1k_in_2k' doesn't have this option
CREATE TABLE t_zip2k_in_2k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=2 TABLESPACE s_2k;
CREATE TABLE t_zip4k_in_2k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=4 TABLESPACE s_2k;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
Error 1031 Table storage engine for 't_zip4k_in_2k' doesn't have this option
CREATE TABLE t_zip8k_in_2k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=8 TABLESPACE s_2k;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 8192
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 8192
Error 1031 Table storage engine for 't_zip8k_in_2k' doesn't have this option
CREATE TABLE t_zip16k_in_2k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=16 TABLESPACE s_2k;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 16384
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 16384
Error 1031 Table storage engine for 't_zip16k_in_2k' doesn't have this option
CREATE TABLE t_zip32k_in_2k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=32 TABLESPACE s_2k;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 32768
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 32768
Error 1031 Table storage engine for 't_zip32k_in_2k' doesn't have this option
CREATE TABLE t_red_in_2k (a int, b text) ROW_FORMAT=Redundant TABLESPACE s_2k;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
Error 1031 Table storage engine for 't_red_in_2k' doesn't have this option
CREATE TABLE t_cmp_in_2k (a int, b text) ROW_FORMAT=Compact TABLESPACE s_2k;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
Error 1031 Table storage engine for 't_cmp_in_2k' doesn't have this option
CREATE TABLE t_dyn_in_2k (a int, b text) ROW_FORMAT=Dynamic TABLESPACE s_2k;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
Error 1031 Table storage engine for 't_dyn_in_2k' doesn't have this option
#
# Add tables to the 4K tablespace.
#
CREATE TABLE t_zip1k_in_4k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=1 TABLESPACE s_4k;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1031 Table storage engine for 't_zip1k_in_4k' doesn't have this option
CREATE TABLE t_zip2k_in_4k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=2 TABLESPACE s_4k;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1031 Table storage engine for 't_zip2k_in_4k' doesn't have this option
CREATE TABLE t_zip4k_in_4k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=4 TABLESPACE s_4k;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1031 Table storage engine for 't_zip4k_in_4k' doesn't have this option
CREATE TABLE t_zip8k_in_4k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=8 TABLESPACE s_4k;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1031 Table storage engine for 't_zip8k_in_4k' doesn't have this option
CREATE TABLE t_zip16k_in_4k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=16 TABLESPACE s_4k;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1031 Table storage engine for 't_zip16k_in_4k' doesn't have this option
CREATE TABLE t_zip32k_in_4k (a int, b text) ROW_FORMAT=Compressed KEY_BLOCK_SIZE=32 TABLESPACE s_4k;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1031 Table storage engine for 't_zip32k_in_4k' doesn't have this option
CREATE TABLE t_red_in_4k (a int, b text) ROW_FORMAT=redundant TABLESPACE s_4k;
CREATE TABLE t_com_in_4k (a int, b text) ROW_FORMAT=compact TABLESPACE s_4k;
CREATE TABLE t_dyn_in_4k (a int, b text) ROW_FORMAT=dynamic TABLESPACE s_4k;
# Add data to the existing Tables
INSERT INTO t_zip1k_in_1k VALUES (1,'a'),(2,'b'),(3,'c');
INSERT INTO t_zip2k_in_2k VALUES (1,'a'),(2,'b'),(3,'c');
INSERT INTO t_red_in_4k VALUES (1,'a'),(2,'b'),(3,'c');
INSERT INTO t_com_in_4k VALUES (1,'a'),(2,'b'),(3,'c');
INSERT INTO t_dyn_in_4k VALUES (1,'a'),(2,'b'),(3,'c');
# Restart mysqld
# restart
#
# Try to drop a tablespace which is not empty
#
DROP TABLESPACE s_4k;
ERROR HY000: Tablespace `s_4k` is not empty.
#
# Add more data to the existing Tables
#
INSERT INTO t_zip1k_in_1k VALUES (4,'d');
INSERT INTO t_zip2k_in_2k VALUES (4,'d');
INSERT INTO t_red_in_4k VALUES (4,'d');
INSERT INTO t_com_in_4k VALUES (4,'d');
INSERT INTO t_dyn_in_4k VALUES (4,'d');
#
# Create an empty copy of each table using LIKE
#
CREATE TABLE t_zip1k_in_1k_like LIKE t_zip1k_in_1k;
CREATE TABLE t_zip2k_in_2k_like LIKE t_zip2k_in_2k;
CREATE TABLE t_red_in_4k_like LIKE t_red_in_4k;
CREATE TABLE t_com_in_4k_like LIKE t_com_in_4k;
CREATE TABLE t_dyn_in_4k_like LIKE t_dyn_in_4k;
#
# Create a full copy of each table using AS
#
CREATE TABLE t_zip1k_in_1k_as TABLESPACE=s_1k KEY_BLOCK_SIZE=1 AS (SELECT * FROM t_zip1k_in_1k);
CREATE TABLE t_zip2k_in_2k_as TABLESPACE=s_2k KEY_BLOCK_SIZE=2 AS (SELECT * FROM t_zip2k_in_2k);
CREATE TABLE t_red_in_4k_as TABLESPACE=s_4k ROW_FORMAT=redundant AS (SELECT * FROM t_red_in_4k);
CREATE TABLE t_com_in_4k_as TABLESPACE=s_4k ROW_FORMAT=compact AS (SELECT * FROM t_com_in_4k);
CREATE TABLE t_dyn_in_4k_as TABLESPACE=s_4k ROW_FORMAT=dynamic AS (SELECT * FROM t_dyn_in_4k);
#
# Create a copy of the 1k table, moving it to another tablespace with a different
# FILE_BLOCK_SIZE, while changing the KEY_BLOCK_SIZE.
#
CREATE TABLE t_zip2k_in_2k_from_1k TABLESPACE s_2k KEY_BLOCK_SIZE=2 AS (SELECT * FROM t_zip1k_in_1k);
CREATE TABLE t_red_in_4k_from_1k TABLESPACE s_4k ROW_FORMAT=redundant AS (SELECT * FROM t_zip1k_in_1k);
CREATE TABLE t_com_in_4k_from_1k TABLESPACE s_4k ROW_FORMAT=compact AS (SELECT * FROM t_zip1k_in_1k);
CREATE TABLE t_dyn_in_4k_from_1k TABLESPACE s_4k ROW_FORMAT=dynamic AS (SELECT * FROM t_zip1k_in_1k);
=== information_schema.innodb_tablespaces and innodb_datafiles ===
Space_Name Space_Type Page_Size Zip_Size BlockSize!=0 FileSize!=0 Formats_Permitted Path
mtr/asserted_test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k General DEFAULT 1024 1 1 Compressed s_1k.ibd
s_2k General DEFAULT 2048 1 1 Compressed s_2k.ibd
s_4k General DEFAULT 0 1 1 Any s_4k.ibd
=== information_schema.files ===
Space_Name File_Type Engine Status Tablespace_Name Path
mtr/asserted_test_suppressions TABLESPACE InnoDB NORMAL mtr/asserted_test_suppressions MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions TABLESPACE InnoDB NORMAL mtr/global_suppressions MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions TABLESPACE InnoDB NORMAL mtr/test_ignored_global_suppressions MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions TABLESPACE InnoDB NORMAL mtr/test_suppressions MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k TABLESPACE InnoDB NORMAL s_1k MYSQLD_DATADIR/s_1k.ibd
s_2k TABLESPACE InnoDB NORMAL s_2k MYSQLD_DATADIR/s_2k.ibd
s_4k TABLESPACE InnoDB NORMAL s_4k MYSQLD_DATADIR/s_4k.ibd
=== information_schema.innodb_tables and innodb_tablespaces ===
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
mtr/asserted_test_suppressions mtr/asserted_test_suppressions 33 4 Dynamic 0 Single
mtr/global_suppressions mtr/global_suppressions 33 4 Dynamic 0 Single
mtr/test_ignored_global_suppressions mtr/test_ignored_global_suppressions 33 4 Dynamic 0 Single
mtr/test_suppressions mtr/test_suppressions 33 4 Dynamic 0 Single
test/t_com_in_4k s_4k 129 5 Compact 0 General
test/t_com_in_4k_as s_4k 129 5 Compact 0 General
test/t_com_in_4k_from_1k s_4k 129 5 Compact 0 General
test/t_com_in_4k_like s_4k 129 5 Compact 0 General
test/t_dyn_in_4k s_4k 161 5 Dynamic 0 General
test/t_dyn_in_4k_as s_4k 161 5 Dynamic 0 General
test/t_dyn_in_4k_from_1k s_4k 161 5 Dynamic 0 General
test/t_dyn_in_4k_like s_4k 161 5 Dynamic 0 General
test/t_red_in_4k s_4k 128 5 Redundant 0 General
test/t_red_in_4k_as s_4k 128 5 Redundant 0 General
test/t_red_in_4k_from_1k s_4k 128 5 Redundant 0 General
test/t_red_in_4k_like s_4k 128 5 Redundant 0 General
test/t_zip1k_in_1k s_1k 163 5 Compressed 1024 General
test/t_zip1k_in_1k_as s_1k 163 5 Compressed 1024 General
test/t_zip1k_in_1k_like s_1k 163 5 Compressed 1024 General
test/t_zip2k_in_2k s_2k 165 5 Compressed 2048 General
test/t_zip2k_in_2k_as s_2k 165 5 Compressed 2048 General
test/t_zip2k_in_2k_from_1k s_2k 165 5 Compressed 2048 General
test/t_zip2k_in_2k_like s_2k 165 5 Compressed 2048 General
# Directory of MYSQLD_DATADIR/
mysql.ibd
s_1k.ibd
s_2k.ibd
s_4k.ibd
# Directory of MYSQLD_DATADIR/test/
#
# Restart the server and make sure that everything is OK.
#
# restart
=== information_schema.innodb_tablespaces and innodb_datafiles ===
Space_Name Space_Type Page_Size Zip_Size BlockSize!=0 FileSize!=0 Formats_Permitted Path
mtr/asserted_test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k General DEFAULT 1024 1 1 Compressed s_1k.ibd
s_2k General DEFAULT 2048 1 1 Compressed s_2k.ibd
s_4k General DEFAULT 0 1 1 Any s_4k.ibd
=== information_schema.files ===
Space_Name File_Type Engine Status Tablespace_Name Path
mtr/asserted_test_suppressions TABLESPACE InnoDB NORMAL mtr/asserted_test_suppressions MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions TABLESPACE InnoDB NORMAL mtr/global_suppressions MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions TABLESPACE InnoDB NORMAL mtr/test_ignored_global_suppressions MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions TABLESPACE InnoDB NORMAL mtr/test_suppressions MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k TABLESPACE InnoDB NORMAL s_1k MYSQLD_DATADIR/s_1k.ibd
s_2k TABLESPACE InnoDB NORMAL s_2k MYSQLD_DATADIR/s_2k.ibd
s_4k TABLESPACE InnoDB NORMAL s_4k MYSQLD_DATADIR/s_4k.ibd
=== information_schema.innodb_tables and innodb_tablespaces ===
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
mtr/asserted_test_suppressions mtr/asserted_test_suppressions 33 4 Dynamic 0 Single
mtr/global_suppressions mtr/global_suppressions 33 4 Dynamic 0 Single
mtr/test_ignored_global_suppressions mtr/test_ignored_global_suppressions 33 4 Dynamic 0 Single
mtr/test_suppressions mtr/test_suppressions 33 4 Dynamic 0 Single
test/t_com_in_4k s_4k 129 5 Compact 0 General
test/t_com_in_4k_as s_4k 129 5 Compact 0 General
test/t_com_in_4k_from_1k s_4k 129 5 Compact 0 General
test/t_com_in_4k_like s_4k 129 5 Compact 0 General
test/t_dyn_in_4k s_4k 161 5 Dynamic 0 General
test/t_dyn_in_4k_as s_4k 161 5 Dynamic 0 General
test/t_dyn_in_4k_from_1k s_4k 161 5 Dynamic 0 General
test/t_dyn_in_4k_like s_4k 161 5 Dynamic 0 General
test/t_red_in_4k s_4k 128 5 Redundant 0 General
test/t_red_in_4k_as s_4k 128 5 Redundant 0 General
test/t_red_in_4k_from_1k s_4k 128 5 Redundant 0 General
test/t_red_in_4k_like s_4k 128 5 Redundant 0 General
test/t_zip1k_in_1k s_1k 163 5 Compressed 1024 General
test/t_zip1k_in_1k_as s_1k 163 5 Compressed 1024 General
test/t_zip1k_in_1k_like s_1k 163 5 Compressed 1024 General
test/t_zip2k_in_2k s_2k 165 5 Compressed 2048 General
test/t_zip2k_in_2k_as s_2k 165 5 Compressed 2048 General
test/t_zip2k_in_2k_from_1k s_2k 165 5 Compressed 2048 General
test/t_zip2k_in_2k_like s_2k 165 5 Compressed 2048 General
# Directory of MYSQLD_DATADIR/
mysql.ibd
s_1k.ibd
s_2k.ibd
s_4k.ibd
# Directory of MYSQLD_DATADIR/test/
#
# Clean-up tables we no longer need
#
DROP TABLE t_zip1k_in_1k_like;
DROP TABLE t_zip2k_in_2k_like;
DROP TABLE t_red_in_4k_like;
DROP TABLE t_com_in_4k_like;
DROP TABLE t_dyn_in_4k_like;
DROP TABLE t_zip1k_in_1k_as;
DROP TABLE t_zip2k_in_2k_as;
DROP TABLE t_red_in_4k_as;
DROP TABLE t_com_in_4k_as;
DROP TABLE t_dyn_in_4k_as;
DROP TABLE t_zip2k_in_2k_from_1k;
DROP TABLE t_red_in_4k_from_1k;
DROP TABLE t_com_in_4k_from_1k;
DROP TABLE t_dyn_in_4k_from_1k;
CHECK TABLE t_zip1k_in_1k;
Table Op Msg_type Msg_text
test.t_zip1k_in_1k check status OK
CHECK TABLE t_zip2k_in_2k;
Table Op Msg_type Msg_text
test.t_zip2k_in_2k check status OK
CHECK TABLE t_red_in_4k;
Table Op Msg_type Msg_text
test.t_red_in_4k check status OK
CHECK TABLE t_com_in_4k;
Table Op Msg_type Msg_text
test.t_com_in_4k check status OK
CHECK TABLE t_dyn_in_4k;
Table Op Msg_type Msg_text
test.t_dyn_in_4k check status OK
DROP TABLE t_zip1k_in_1k;
DROP TABLE t_zip2k_in_2k;
DROP TABLE t_red_in_4k;
DROP TABLE t_com_in_4k;
DROP TABLE t_dyn_in_4k;
#
# Create compressed tables explicitly as file_per_table tablespaces.
#
CREATE TABLE t_zip1k_as_file_per_table (a int, b text) TABLESPACE=innodb_file_per_table ROW_FORMAT=compressed KEY_BLOCK_SIZE=1;
CREATE TABLE t_zip2k_as_file_per_table (a int, b text) TABLESPACE=innodb_file_per_table ROW_FORMAT=compressed KEY_BLOCK_SIZE=2;
CREATE TABLE t_zip4k_as_file_per_table (a int, b text) TABLESPACE=innodb_file_per_table ROW_FORMAT=compressed KEY_BLOCK_SIZE=4;
#
# Create compressed tables in remote locations using file-per-table.
#
CREATE TABLE t_zip1k_as_remote (a int, b text) KEY_BLOCK_SIZE=1 TABLESPACE=innodb_file_per_table DATA DIRECTORY='MYSQL_TMP_DIR';
CREATE TABLE t_zip2k_as_remote (a int, b text) KEY_BLOCK_SIZE=2 TABLESPACE=innodb_file_per_table DATA DIRECTORY='MYSQL_TMP_DIR';
CREATE TABLE t_zip4k_as_remote (a int, b text) KEY_BLOCK_SIZE=4 TABLESPACE=innodb_file_per_table DATA DIRECTORY='MYSQL_TMP_DIR';
=== information_schema.innodb_tablespaces and innodb_datafiles ===
Space_Name Space_Type Page_Size Zip_Size BlockSize!=0 FileSize!=0 Formats_Permitted Path
mtr/asserted_test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k General DEFAULT 1024 1 1 Compressed s_1k.ibd
s_2k General DEFAULT 2048 1 1 Compressed s_2k.ibd
s_4k General DEFAULT 0 1 1 Any s_4k.ibd
test/t_zip1k_as_file_per_table Single DEFAULT 1024 1 1 Compressed MYSQLD_DATADIR/test/t_zip1k_as_file_per_table.ibd
test/t_zip1k_as_remote Single DEFAULT 1024 1 1 Compressed MYSQL_TMP_DIR/test/t_zip1k_as_remote.ibd
test/t_zip2k_as_file_per_table Single DEFAULT 2048 1 1 Compressed MYSQLD_DATADIR/test/t_zip2k_as_file_per_table.ibd
test/t_zip2k_as_remote Single DEFAULT 2048 1 1 Compressed MYSQL_TMP_DIR/test/t_zip2k_as_remote.ibd
test/t_zip4k_as_file_per_table Single DEFAULT DEFAULT 1 1 Compressed MYSQLD_DATADIR/test/t_zip4k_as_file_per_table.ibd
test/t_zip4k_as_remote Single DEFAULT DEFAULT 1 1 Compressed MYSQL_TMP_DIR/test/t_zip4k_as_remote.ibd
=== information_schema.files ===
Space_Name File_Type Engine Status Tablespace_Name Path
mtr/asserted_test_suppressions TABLESPACE InnoDB NORMAL mtr/asserted_test_suppressions MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions TABLESPACE InnoDB NORMAL mtr/global_suppressions MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions TABLESPACE InnoDB NORMAL mtr/test_ignored_global_suppressions MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions TABLESPACE InnoDB NORMAL mtr/test_suppressions MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k TABLESPACE InnoDB NORMAL s_1k MYSQLD_DATADIR/s_1k.ibd
s_2k TABLESPACE InnoDB NORMAL s_2k MYSQLD_DATADIR/s_2k.ibd
s_4k TABLESPACE InnoDB NORMAL s_4k MYSQLD_DATADIR/s_4k.ibd
test/t_zip1k_as_file_per_table TABLESPACE InnoDB NORMAL test/t_zip1k_as_file_per_table MYSQLD_DATADIR/test/t_zip1k_as_file_per_table.ibd
test/t_zip1k_as_remote TABLESPACE InnoDB NORMAL test/t_zip1k_as_remote MYSQL_TMP_DIR/test/t_zip1k_as_remote.ibd
test/t_zip2k_as_file_per_table TABLESPACE InnoDB NORMAL test/t_zip2k_as_file_per_table MYSQLD_DATADIR/test/t_zip2k_as_file_per_table.ibd
test/t_zip2k_as_remote TABLESPACE InnoDB NORMAL test/t_zip2k_as_remote MYSQL_TMP_DIR/test/t_zip2k_as_remote.ibd
test/t_zip4k_as_file_per_table TABLESPACE InnoDB NORMAL test/t_zip4k_as_file_per_table MYSQLD_DATADIR/test/t_zip4k_as_file_per_table.ibd
test/t_zip4k_as_remote TABLESPACE InnoDB NORMAL test/t_zip4k_as_remote MYSQL_TMP_DIR/test/t_zip4k_as_remote.ibd
=== information_schema.innodb_tables and innodb_tablespaces ===
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
mtr/asserted_test_suppressions mtr/asserted_test_suppressions 33 4 Dynamic 0 Single
mtr/global_suppressions mtr/global_suppressions 33 4 Dynamic 0 Single
mtr/test_ignored_global_suppressions mtr/test_ignored_global_suppressions 33 4 Dynamic 0 Single
mtr/test_suppressions mtr/test_suppressions 33 4 Dynamic 0 Single
test/t_zip1k_as_file_per_table test/t_zip1k_as_file_per_table 35 5 Compressed 1024 Single
test/t_zip1k_as_remote test/t_zip1k_as_remote 99 5 Compressed 1024 Single
test/t_zip2k_as_file_per_table test/t_zip2k_as_file_per_table 37 5 Compressed 2048 Single
test/t_zip2k_as_remote test/t_zip2k_as_remote 101 5 Compressed 2048 Single
test/t_zip4k_as_file_per_table test/t_zip4k_as_file_per_table 39 5 Compressed 4096 Single
test/t_zip4k_as_remote test/t_zip4k_as_remote 103 5 Compressed 4096 Single
# MYSQLD_DATADIR/
mysql.ibd
s_1k.ibd
s_2k.ibd
s_4k.ibd
# MYSQLD_DATADIR/test/
t_zip1k_as_file_per_table.ibd
t_zip2k_as_file_per_table.ibd
t_zip4k_as_file_per_table.ibd
#
# These file_per_table tables cannot be moved to a general tablespace if the
# FILE_BLOCK_SIZE does not match the KEY_BLOCK_SIZE or if the tablespace is
# not compressed.
#
ALTER TABLE `t_zip2k_as_file_per_table` TABLESPACE=`s_1k`;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 2048
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 2048
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip4k_as_file_per_table` TABLESPACE=`s_1k`;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip2k_as_remote` TABLESPACE=`s_1k`;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 2048
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 2048
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip4k_as_remote` TABLESPACE=`s_1k`;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 4096
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip1k_as_file_per_table` TABLESPACE=`s_2k`;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 1024
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 1024
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip4k_as_file_per_table` TABLESPACE=`s_2k`;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip1k_as_remote` TABLESPACE=`s_2k`;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 1024
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 1024
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip4k_as_remote` TABLESPACE=`s_2k`;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 4096
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip1k_as_file_per_table` TABLESPACE=`s_4k`;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip2k_as_file_per_table` TABLESPACE=`s_4k`;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip1k_as_remote` TABLESPACE=`s_4k`;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip2k_as_remote` TABLESPACE=`s_4k`;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
DROP TABLE `t_zip4k_as_remote`;
#
# These explicit file_per_table tables can be moved to a general tablespace
# if FILE_BLOCK_SIZE matches KEY_BLOCK_SIZE and the tablespace is compressed.
#
ALTER TABLE `t_zip1k_as_file_per_table` TABLESPACE=`s_1k`, RENAME TO `t_zip1k_in_s_1k`;
ALTER TABLE `t_zip2k_as_file_per_table` TABLESPACE=`s_2k`, RENAME TO `t_zip2k_in_s_2k`;
ALTER TABLE `t_zip1k_as_remote` TABLESPACE=`s_1k`, RENAME TO `t_zip1k_remote_in_s_1k`;
ALTER TABLE `t_zip2k_as_remote` TABLESPACE=`s_2k`, RENAME TO `t_zip2k_remote_in_s_2k`;
=== information_schema.innodb_tablespaces and innodb_datafiles ===
Space_Name Space_Type Page_Size Zip_Size BlockSize!=0 FileSize!=0 Formats_Permitted Path
mtr/asserted_test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k General DEFAULT 1024 1 1 Compressed s_1k.ibd
s_2k General DEFAULT 2048 1 1 Compressed s_2k.ibd
s_4k General DEFAULT 0 1 1 Any s_4k.ibd
test/t_zip4k_as_file_per_table Single DEFAULT DEFAULT 1 1 Compressed MYSQLD_DATADIR/test/t_zip4k_as_file_per_table.ibd
=== information_schema.files ===
Space_Name File_Type Engine Status Tablespace_Name Path
mtr/asserted_test_suppressions TABLESPACE InnoDB NORMAL mtr/asserted_test_suppressions MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions TABLESPACE InnoDB NORMAL mtr/global_suppressions MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions TABLESPACE InnoDB NORMAL mtr/test_ignored_global_suppressions MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions TABLESPACE InnoDB NORMAL mtr/test_suppressions MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k TABLESPACE InnoDB NORMAL s_1k MYSQLD_DATADIR/s_1k.ibd
s_2k TABLESPACE InnoDB NORMAL s_2k MYSQLD_DATADIR/s_2k.ibd
s_4k TABLESPACE InnoDB NORMAL s_4k MYSQLD_DATADIR/s_4k.ibd
test/t_zip4k_as_file_per_table TABLESPACE InnoDB NORMAL test/t_zip4k_as_file_per_table MYSQLD_DATADIR/test/t_zip4k_as_file_per_table.ibd
=== information_schema.innodb_tables and innodb_tablespaces ===
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
mtr/asserted_test_suppressions mtr/asserted_test_suppressions 33 4 Dynamic 0 Single
mtr/global_suppressions mtr/global_suppressions 33 4 Dynamic 0 Single
mtr/test_ignored_global_suppressions mtr/test_ignored_global_suppressions 33 4 Dynamic 0 Single
mtr/test_suppressions mtr/test_suppressions 33 4 Dynamic 0 Single
test/t_zip1k_in_s_1k s_1k 163 5 Compressed 1024 General
test/t_zip1k_remote_in_s_1k s_1k 163 5 Compressed 1024 General
test/t_zip2k_in_s_2k s_2k 165 5 Compressed 2048 General
test/t_zip2k_remote_in_s_2k s_2k 165 5 Compressed 2048 General
test/t_zip4k_as_file_per_table test/t_zip4k_as_file_per_table 39 5 Compressed 4096 Single
# MYSQLD_DATADIR/
mysql.ibd
s_1k.ibd
s_2k.ibd
s_4k.ibd
# MYSQLD_DATADIR/test/
t_zip4k_as_file_per_table.ibd
CHECK TABLE `t_zip1k_in_s_1k`;
Table Op Msg_type Msg_text
test.t_zip1k_in_s_1k check status OK
CHECK TABLE `t_zip2k_in_s_2k`;
Table Op Msg_type Msg_text
test.t_zip2k_in_s_2k check status OK
CHECK TABLE `t_zip1k_remote_in_s_1k`;
Table Op Msg_type Msg_text
test.t_zip1k_remote_in_s_1k check status OK
CHECK TABLE `t_zip2k_remote_in_s_2k`;
Table Op Msg_type Msg_text
test.t_zip2k_remote_in_s_2k check status OK
#
# Tables in general tablespaces cannot be moved to another general tablespace if the
# FILE_BLOCK_SIZE does not match the KEY_BLOCK_SIZE or if the tablespace is
# not compressed.
#
ALTER TABLE `t_zip2k_in_s_2k` TABLESPACE=`s_1k`;
ERROR HY000: InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 2048
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_1k` uses block size 1024 and cannot contain a table with physical page size 2048
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip1k_in_s_1k` TABLESPACE=`s_2k`;
ERROR HY000: InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 1024
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_2k` uses block size 2048 and cannot contain a table with physical page size 1024
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip1k_in_s_1k` TABLESPACE=`s_4k`;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
ALTER TABLE `t_zip2k_in_s_2k` TABLESPACE=`s_4k`;
ERROR HY000: InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
SHOW WARNINGS;
Level Code Message
Error 1478 InnoDB: Tablespace `s_4k` cannot contain a COMPRESSED table
Error 1478 Table storage engine 'InnoDB' does not support the create option 'TABLESPACE'
#
# Tables in a general tablespace can be moved to file_per_table locations.
#
ALTER TABLE `t_zip1k_in_s_1k` TABLESPACE=`innodb_file_per_table`, RENAME TO `t_zip1k_to_file_per_table`;
ALTER TABLE `t_zip2k_in_s_2k` TABLESPACE=`innodb_file_per_table`, RENAME TO `t_zip2k_to_file_per_table`;
=== information_schema.innodb_tablespaces and innodb_datafiles ===
Space_Name Space_Type Page_Size Zip_Size BlockSize!=0 FileSize!=0 Formats_Permitted Path
mtr/asserted_test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k General DEFAULT 1024 1 1 Compressed s_1k.ibd
s_2k General DEFAULT 2048 1 1 Compressed s_2k.ibd
s_4k General DEFAULT 0 1 1 Any s_4k.ibd
test/t_zip1k_to_file_per_table Single DEFAULT 1024 1 1 Compressed MYSQLD_DATADIR/test/t_zip1k_to_file_per_table.ibd
test/t_zip2k_to_file_per_table Single DEFAULT 2048 1 1 Compressed MYSQLD_DATADIR/test/t_zip2k_to_file_per_table.ibd
test/t_zip4k_as_file_per_table Single DEFAULT DEFAULT 1 1 Compressed MYSQLD_DATADIR/test/t_zip4k_as_file_per_table.ibd
=== information_schema.files ===
Space_Name File_Type Engine Status Tablespace_Name Path
mtr/asserted_test_suppressions TABLESPACE InnoDB NORMAL mtr/asserted_test_suppressions MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions TABLESPACE InnoDB NORMAL mtr/global_suppressions MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions TABLESPACE InnoDB NORMAL mtr/test_ignored_global_suppressions MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions TABLESPACE InnoDB NORMAL mtr/test_suppressions MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k TABLESPACE InnoDB NORMAL s_1k MYSQLD_DATADIR/s_1k.ibd
s_2k TABLESPACE InnoDB NORMAL s_2k MYSQLD_DATADIR/s_2k.ibd
s_4k TABLESPACE InnoDB NORMAL s_4k MYSQLD_DATADIR/s_4k.ibd
test/t_zip1k_to_file_per_table TABLESPACE InnoDB NORMAL test/t_zip1k_to_file_per_table MYSQLD_DATADIR/test/t_zip1k_to_file_per_table.ibd
test/t_zip2k_to_file_per_table TABLESPACE InnoDB NORMAL test/t_zip2k_to_file_per_table MYSQLD_DATADIR/test/t_zip2k_to_file_per_table.ibd
test/t_zip4k_as_file_per_table TABLESPACE InnoDB NORMAL test/t_zip4k_as_file_per_table MYSQLD_DATADIR/test/t_zip4k_as_file_per_table.ibd
=== information_schema.innodb_tables and innodb_tablespaces ===
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
mtr/asserted_test_suppressions mtr/asserted_test_suppressions 33 4 Dynamic 0 Single
mtr/global_suppressions mtr/global_suppressions 33 4 Dynamic 0 Single
mtr/test_ignored_global_suppressions mtr/test_ignored_global_suppressions 33 4 Dynamic 0 Single
mtr/test_suppressions mtr/test_suppressions 33 4 Dynamic 0 Single
test/t_zip1k_remote_in_s_1k s_1k 163 5 Compressed 1024 General
test/t_zip1k_to_file_per_table test/t_zip1k_to_file_per_table 35 5 Compressed 1024 Single
test/t_zip2k_remote_in_s_2k s_2k 165 5 Compressed 2048 General
test/t_zip2k_to_file_per_table test/t_zip2k_to_file_per_table 37 5 Compressed 2048 Single
test/t_zip4k_as_file_per_table test/t_zip4k_as_file_per_table 39 5 Compressed 4096 Single
CHECK TABLE `t_zip1k_to_file_per_table`;
Table Op Msg_type Msg_text
test.t_zip1k_to_file_per_table check status OK
CHECK TABLE `t_zip2k_to_file_per_table`;
Table Op Msg_type Msg_text
test.t_zip2k_to_file_per_table check status OK
CHECK TABLE `t_zip4k_as_file_per_table`;
Table Op Msg_type Msg_text
test.t_zip4k_as_file_per_table check status OK
DROP TABLE `t_zip1k_to_file_per_table`;
DROP TABLE `t_zip2k_to_file_per_table`;
DROP TABLE `t_zip4k_as_file_per_table`;
#
# Tables in a general tablespace cannot be moved to remote file_per_table locations
# because MySQL ignores DATA DIRECTORY in ALTER TABLE.
#
ALTER TABLE `t_zip1k_remote_in_s_1k` TABLESPACE=`innodb_file_per_table`, DATA DIRECTORY='$MYSQL_TMP_DIR', RENAME TO `t_zip1k_to_file_per_table`;
Warnings:
Warning 1618 <DATA DIRECTORY> option ignored
ALTER TABLE `t_zip2k_remote_in_s_2k` TABLESPACE=`innodb_file_per_table`, DATA DIRECTORY='$MYSQL_TMP_DIR', RENAME TO `t_zip2k_to_file_per_table`;
Warnings:
Warning 1618 <DATA DIRECTORY> option ignored
=== information_schema.innodb_tablespaces and innodb_datafiles ===
Space_Name Space_Type Page_Size Zip_Size BlockSize!=0 FileSize!=0 Formats_Permitted Path
mtr/asserted_test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions Single DEFAULT 0 1 1 Dynamic MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k General DEFAULT 1024 1 1 Compressed s_1k.ibd
s_2k General DEFAULT 2048 1 1 Compressed s_2k.ibd
s_4k General DEFAULT 0 1 1 Any s_4k.ibd
test/t_zip1k_to_file_per_table Single DEFAULT 1024 1 1 Compressed MYSQLD_DATADIR/test/t_zip1k_to_file_per_table.ibd
test/t_zip2k_to_file_per_table Single DEFAULT 2048 1 1 Compressed MYSQLD_DATADIR/test/t_zip2k_to_file_per_table.ibd
=== information_schema.files ===
Space_Name File_Type Engine Status Tablespace_Name Path
mtr/asserted_test_suppressions TABLESPACE InnoDB NORMAL mtr/asserted_test_suppressions MYSQLD_DATADIR/mtr/asserted_test_suppressions.ibd
mtr/global_suppressions TABLESPACE InnoDB NORMAL mtr/global_suppressions MYSQLD_DATADIR/mtr/global_suppressions.ibd
mtr/test_ignored_global_suppressions TABLESPACE InnoDB NORMAL mtr/test_ignored_global_suppressions MYSQLD_DATADIR/mtr/test_ignored_global_suppressions.ibd
mtr/test_suppressions TABLESPACE InnoDB NORMAL mtr/test_suppressions MYSQLD_DATADIR/mtr/test_suppressions.ibd
s_1k TABLESPACE InnoDB NORMAL s_1k MYSQLD_DATADIR/s_1k.ibd
s_2k TABLESPACE InnoDB NORMAL s_2k MYSQLD_DATADIR/s_2k.ibd
s_4k TABLESPACE InnoDB NORMAL s_4k MYSQLD_DATADIR/s_4k.ibd
test/t_zip1k_to_file_per_table TABLESPACE InnoDB NORMAL test/t_zip1k_to_file_per_table MYSQLD_DATADIR/test/t_zip1k_to_file_per_table.ibd
test/t_zip2k_to_file_per_table TABLESPACE InnoDB NORMAL test/t_zip2k_to_file_per_table MYSQLD_DATADIR/test/t_zip2k_to_file_per_table.ibd
=== information_schema.innodb_tables and innodb_tablespaces ===
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
mtr/asserted_test_suppressions mtr/asserted_test_suppressions 33 4 Dynamic 0 Single
mtr/global_suppressions mtr/global_suppressions 33 4 Dynamic 0 Single
mtr/test_ignored_global_suppressions mtr/test_ignored_global_suppressions 33 4 Dynamic 0 Single
mtr/test_suppressions mtr/test_suppressions 33 4 Dynamic 0 Single
test/t_zip1k_to_file_per_table test/t_zip1k_to_file_per_table 35 5 Compressed 1024 Single
test/t_zip2k_to_file_per_table test/t_zip2k_to_file_per_table 37 5 Compressed 2048 Single
DROP TABLE `t_zip1k_to_file_per_table`;
DROP TABLE `t_zip2k_to_file_per_table`;
#
# Clean-up.
#
DROP TABLESPACE s_1k;
DROP TABLESPACE s_2k;
DROP TABLESPACE s_4k;
|