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
|
# needed in sourced show_i_s_tablespaces.inc
let $MYSQLD_DATADIR = `select @@datadir`;
let $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
CREATE TABLESPACE s1 ADD DATAFILE 's1.ibd' ENGINE InnoDB;
# Change tablespace of partitioned table from innodb_file_per_table
# to general tablespace
CREATE TABLE t1 (col1 INT, col2 INT) ENGINE = InnoDB TABLESPACE innodb_file_per_table PARTITION BY KEY(col1) PARTITIONS 3;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE s1;
SHOW CREATE TABLE t1;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE innodb_file_per_table;
SHOW CREATE TABLE t1;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
DROP TABLE t1;
# Change tablespace of partitioned table from innodb_system
# to general tablespace
CREATE TABLE t1 (col1 INT, col2 INT) ENGINE = InnoDB TABLESPACE innodb_system PARTITION BY KEY(col1) PARTITIONS 3;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE s1;
SHOW CREATE TABLE t1;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE innodb_system;
SHOW CREATE TABLE t1;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
DROP TABLE t1;
# Change tablespace of partitioned table from general tablespace
# to innodb_file_per_table
CREATE TABLE t1 (col1 INT, col2 INT) ENGINE = InnoDB TABLESPACE s1 PARTITION BY KEY(col1) PARTITIONS 3;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE innodb_file_per_table;
SHOW CREATE TABLE t1;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE s1;
SHOW CREATE TABLE t1;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
DROP TABLE t1;
# Change tablespace of partitioned table from general tablespace
# to innodb_system
CREATE TABLE t1 (col1 INT, col2 INT) ENGINE = InnoDB TABLESPACE s1 PARTITION BY KEY(col1) PARTITIONS 3;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE innodb_system;
SHOW CREATE TABLE t1;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE s1;
SHOW CREATE TABLE t1;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc
DROP TABLE t1;
DROP TABLESPACE s1;
--echo #
--echo # Check if tablespace id of general tablespace or system tablespace
--echo # are set properly
--echo #
CREATE TABLESPACE gt1 ADD DATAFILE '1.ibd' FILE_BLOCK_SIZE = 16k ENGINE = InnoDB;
CREATE TABLE t1 (col1 INT) ENGINE = InnoDB TABLESPACE gt1;
ALTER TABLE t1 ENGINE = InnoDB PARTITION BY RANGE(col1 * 2)
( PARTITION p3 VALUES LESS THAN MAXVALUE );
SHOW CREATE TABLE t1;
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE innodb_system;
SHOW CREATE TABLE t1;
TRUNCATE TABLE t1;
SHOW CREATE TABLE t1;
ALTER TABLE t1 ENGINE = InnoDB TABLESPACE gt1;
SHOW CREATE TABLE t1;
DROP TABLE t1;
DROP TABLESPACE gt1;
|