mirror of
https://github.com/MariaDB/server.git
synced 2025-11-12 10:22:39 +03:00
Implement undo tablespace truncation via normal redo logging. Implement TRUNCATE TABLE as a combination of RENAME to #sql-ib name, CREATE, and DROP. Note: Orphan #sql-ib*.ibd may be left behind if MariaDB Server 10.2 is killed before the DROP operation is committed. If MariaDB Server 10.2 is killed during TRUNCATE, it is also possible that the old table was renamed to #sql-ib*.ibd but the data dictionary will refer to the table using the original name. In MariaDB Server 10.3, RENAME inside InnoDB is transactional, and #sql-* tables will be dropped on startup. So, this new TRUNCATE will be fully crash-safe in 10.3. ha_mroonga::wrapper_truncate(): Pass table options to the underlying storage engine, now that ha_innobase::truncate() will need them. rpl_slave_state::truncate_state_table(): Before truncating mysql.gtid_slave_pos, evict any cached table handles from the table definition cache, so that there will be no stale references to the old table after truncating. == TRUNCATE TABLE == WL#6501 in MySQL 5.7 introduced separate log files for implementing atomic and crash-safe TRUNCATE TABLE, instead of using the InnoDB undo and redo log. Some convoluted logic was added to the InnoDB crash recovery, and some extra synchronization (including a redo log checkpoint) was introduced to make this work. This synchronization has caused performance problems and race conditions, and the extra log files cannot be copied or applied by external backup programs. In order to support crash-upgrade from MariaDB 10.2, we will keep the logic for parsing and applying the extra log files, but we will no longer generate those files in TRUNCATE TABLE. A prerequisite for crash-safe TRUNCATE is a crash-safe RENAME TABLE (with full redo and undo logging and proper rollback). This will be implemented in MDEV-14717. ha_innobase::truncate(): Invoke RENAME, create(), delete_table(). Because RENAME cannot be fully rolled back before MariaDB 10.3 due to missing undo logging, add some explicit rename-back in case the operation fails. ha_innobase::delete(): Introduce a variant that takes sqlcom as a parameter. In TRUNCATE TABLE, we do not want to touch any FOREIGN KEY constraints. ha_innobase::create(): Add the parameters file_per_table, trx. In TRUNCATE, the new table must be created in the same transaction that renames the old table. create_table_info_t::create_table_info_t(): Add the parameters file_per_table, trx. row_drop_table_for_mysql(): Replace a bool parameter with sqlcom. row_drop_table_after_create_fail(): New function, wrapping row_drop_table_for_mysql(). dict_truncate_index_tree_in_mem(), fil_truncate_tablespace(), fil_prepare_for_truncate(), fil_reinit_space_header_for_table(), row_truncate_table_for_mysql(), TruncateLogger, row_truncate_prepare(), row_truncate_rollback(), row_truncate_complete(), row_truncate_fts(), row_truncate_update_system_tables(), row_truncate_foreign_key_checks(), row_truncate_sanity_checks(): Remove. row_upd_check_references_constraints(): Remove a check for TRUNCATE, now that the table is no longer truncated in place. The new test innodb.truncate_foreign uses DEBUG_SYNC to cover some race-condition like scenarios. The test innodb-innodb.truncate does not use any synchronization. We add a redo log subformat to indicate backup-friendly format. MariaDB 10.4 will remove support for the old TRUNCATE logging, so crash-upgrade from old 10.2 or 10.3 to 10.4 will involve limitations. == Undo tablespace truncation == MySQL 5.7 implements undo tablespace truncation. It is only possible when innodb_undo_tablespaces is set to at least 2. The logging is implemented similar to the WL#6501 TRUNCATE, that is, using separate log files and a redo log checkpoint. We can simply implement undo tablespace truncation within a single mini-transaction that reinitializes the undo log tablespace file. Unfortunately, due to the redo log format of some operations, currently, the total redo log written by undo tablespace truncation will be more than the combined size of the truncated undo tablespace. It should be acceptable to have a little more than 1 megabyte of log in a single mini-transaction. This will be fixed in MDEV-17138 in MariaDB Server 10.4. recv_sys_t: Add truncated_undo_spaces[] to remember for which undo tablespaces a MLOG_FILE_CREATE2 record was seen. namespace undo: Remove some unnecessary declarations. fil_space_t::is_being_truncated: Document that this flag now only applies to undo tablespaces. Remove some references. fil_space_t::is_stopping(): Do not refer to is_being_truncated. This check is for tablespaces of tables. Potentially used tablespaces are never truncated any more. buf_dblwr_process(): Suppress the out-of-bounds warning for undo tablespaces. fil_truncate_log(): Write a MLOG_FILE_CREATE2 with a nonzero page number (new size of the tablespace in pages) to inform crash recovery that the undo tablespace size has been reduced. fil_op_write_log(): Relax assertions, so that MLOG_FILE_CREATE2 can be written for undo tablespaces (without .ibd file suffix) for a nonzero page number. os_file_truncate(): Add the parameter allow_shrink=false so that undo tablespaces can actually be shrunk using this function. fil_name_parse(): For undo tablespace truncation, buffer MLOG_FILE_CREATE2 in truncated_undo_spaces[]. recv_read_in_area(): Avoid reading pages for which no redo log records remain buffered, after recv_addr_trim() removed them. trx_rseg_header_create(): Add a FIXME comment that we could write much less redo log. trx_undo_truncate_tablespace(): Reinitialize the undo tablespace in a single mini-transaction, which will be flushed to the redo log before the file size is trimmed. recv_addr_trim(): Discard any redo logs for pages that were logged after the new end of a file, before the truncation LSN. If the rec_list becomes empty, reduce n_addrs. After removing any affected records, actually truncate the file. recv_apply_hashed_log_recs(): Invoke recv_addr_trim() right before applying any log records. The undo tablespace files must be open at this point. buf_flush_or_remove_pages(), buf_flush_dirty_pages(), buf_LRU_flush_or_remove_pages(): Add a parameter for specifying the number of the first page to flush or remove (default 0). trx_purge_initiate_truncate(): Remove the log checkpoints, the extra logging, and some unnecessary crash points. Merge the code from trx_undo_truncate_tablespace(). First, flush all to-be-discarded pages (beyond the new end of the file), then trim the space->size to make the page allocation deterministic. At the only remaining crash injection point, flush the redo log, so that the recovery can be tested.
1069 lines
42 KiB
Plaintext
1069 lines
42 KiB
Plaintext
SET default_storage_engine=InnoDB;
|
|
#
|
|
# A series of tests to make sure tables are opened after restart.
|
|
# Bug#13357607 Compressed file-per-table tablespaces fail to open
|
|
#
|
|
set global innodb_file_per_table=on;
|
|
#
|
|
# Create and insert records into a REDUNDANT row formatted table.
|
|
#
|
|
CREATE TABLE t1_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
|
ROW_FORMAT=REDUNDANT ENGINE=InnoDB;
|
|
INSERT INTO t1_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
|
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
|
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
|
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
|
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
|
SHOW CREATE TABLE t1_restart;
|
|
Table Create Table
|
|
t1_restart CREATE TABLE `t1_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
|
|
SELECT count(*) FROM t1_restart;
|
|
count(*)
|
|
16
|
|
#
|
|
# Create and insert records into a COMPACT row formatted table.
|
|
#
|
|
CREATE TABLE t2_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
|
ROW_FORMAT=COMPACT ENGINE=InnoDB;
|
|
INSERT INTO t2_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
|
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
|
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
|
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
|
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
|
SHOW CREATE TABLE t2_restart;
|
|
Table Create Table
|
|
t2_restart CREATE TABLE `t2_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
|
SELECT count(*) FROM t2_restart;
|
|
count(*)
|
|
16
|
|
#
|
|
# Create and insert records into a COMPRESSED row formatted table.
|
|
#
|
|
CREATE TABLE t3_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
|
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB;
|
|
INSERT INTO t3_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
|
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
|
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
|
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
|
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
|
SHOW CREATE TABLE t3_restart;
|
|
Table Create Table
|
|
t3_restart CREATE TABLE `t3_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
SELECT count(*) FROM t3_restart;
|
|
count(*)
|
|
16
|
|
#
|
|
# Create and insert records into a DYNAMIC row formatted table.
|
|
#
|
|
CREATE TABLE t4_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
|
ROW_FORMAT=DYNAMIC ENGINE=InnoDB;
|
|
INSERT INTO t4_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
|
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
|
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
|
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
|
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
|
SHOW CREATE TABLE t4_restart;
|
|
Table Create Table
|
|
t4_restart CREATE TABLE `t4_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
SELECT count(*) FROM t4_restart;
|
|
count(*)
|
|
16
|
|
#
|
|
# Create and insert records into a table that uses a remote DATA DIRECTORY.
|
|
#
|
|
CREATE TABLE t5_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
|
ROW_FORMAT=DYNAMIC ENGINE=InnoDB DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir';
|
|
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
|
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
|
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
|
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
|
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
|
SHOW CREATE TABLE t5_restart;
|
|
Table Create Table
|
|
t5_restart CREATE TABLE `t5_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
|
|
SELECT count(*) FROM t5_restart;
|
|
count(*)
|
|
16
|
|
#
|
|
# Create and insert records into a partitioned table that uses
|
|
# a remote DATA DIRECTORY for each partition.
|
|
#
|
|
CREATE TABLE t6_restart(
|
|
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
|
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB
|
|
PARTITION BY HASH(c1) (
|
|
PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir',
|
|
PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir',
|
|
PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir');
|
|
INSERT INTO t6_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
|
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
|
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
|
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
|
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
|
SHOW CREATE TABLE t6_restart;
|
|
Table Create Table
|
|
t6_restart CREATE TABLE `t6_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
PARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
|
|
SELECT count(*) FROM t6_restart;
|
|
count(*)
|
|
16
|
|
#
|
|
# Create and insert records into a subpartitioned table that uses
|
|
# a remote DATA DIRECTORY for each subpartition.
|
|
#
|
|
CREATE TABLE t7_restart(
|
|
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT)
|
|
ROW_FORMAT=DYNAMIC ENGINE=InnoDB
|
|
PARTITION BY RANGE(c1) SUBPARTITION BY HASH(c1) (
|
|
PARTITION p0 VALUES LESS THAN (10) (
|
|
SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir',
|
|
SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir'),
|
|
PARTITION p1 VALUES LESS THAN MAXVALUE (
|
|
SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir',
|
|
SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir'));
|
|
INSERT INTO t7_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
|
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
|
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
|
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
|
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
|
SHOW CREATE TABLE t7_restart;
|
|
Table Create Table
|
|
t7_restart CREATE TABLE `t7_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE (`c1`)
|
|
SUBPARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` VALUES LESS THAN (10)
|
|
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
|
|
PARTITION `p1` VALUES LESS THAN MAXVALUE
|
|
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
|
|
SELECT count(*) FROM t7_restart;
|
|
count(*)
|
|
16
|
|
#
|
|
# Show these tables in information_schema.
|
|
#
|
|
=== information_schema.innodb_sys_tables and innodb_sys_tablespaces ===
|
|
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
|
|
test/t1_restart test/t1_restart 0 8 Redundant 0 Single
|
|
test/t2_restart test/t2_restart 1 8 Compact 0 Single
|
|
test/t3_restart test/t3_restart 37 8 Compressed 2048 Single
|
|
test/t4_restart test/t4_restart 33 8 Dynamic 0 Single
|
|
test/t5_restart test/t5_restart 97 8 Dynamic 0 Single
|
|
test/t6_restart#p#p0 test/t6_restart#p#p0 101 8 Compressed 2048 Single
|
|
test/t6_restart#p#p1 test/t6_restart#p#p1 101 8 Compressed 2048 Single
|
|
test/t6_restart#p#p2 test/t6_restart#p#p2 101 8 Compressed 2048 Single
|
|
test/t7_restart#p#p0#sp#s0 test/t7_restart#p#p0#sp#s0 97 8 Dynamic 0 Single
|
|
test/t7_restart#p#p0#sp#s1 test/t7_restart#p#p0#sp#s1 97 8 Dynamic 0 Single
|
|
test/t7_restart#p#p1#sp#s2 test/t7_restart#p#p1#sp#s2 97 8 Dynamic 0 Single
|
|
test/t7_restart#p#p1#sp#s3 test/t7_restart#p#p1#sp#s3 97 8 Dynamic 0 Single
|
|
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
|
|
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
|
|
test/t1_restart Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1_restart.ibd
|
|
test/t2_restart Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2_restart.ibd
|
|
test/t3_restart Single DEFAULT 2048 Compressed MYSQLD_DATADIR/test/t3_restart.ibd
|
|
test/t4_restart Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
|
|
test/t5_restart Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd
|
|
test/t6_restart#p#p0 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd
|
|
test/t6_restart#p#p1 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd
|
|
test/t6_restart#p#p2 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd
|
|
test/t7_restart#p#p0#sp#s0 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd
|
|
test/t7_restart#p#p0#sp#s1 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd
|
|
test/t7_restart#p#p1#sp#s2 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd
|
|
test/t7_restart#p#p1#sp#s3 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd
|
|
#
|
|
# Shutdown the server and list the tablespace OS files
|
|
#
|
|
---- MYSQL_DATA_DIR/test
|
|
t1_restart.frm
|
|
t1_restart.ibd
|
|
t2_restart.frm
|
|
t2_restart.ibd
|
|
t3_restart.frm
|
|
t3_restart.ibd
|
|
t4_restart.frm
|
|
t4_restart.ibd
|
|
t5_restart.frm
|
|
t5_restart.isl
|
|
t6_restart#p#p0.isl
|
|
t6_restart#p#p1.isl
|
|
t6_restart#p#p2.isl
|
|
t6_restart.frm
|
|
t6_restart.par
|
|
t7_restart#p#p0#sp#s0.isl
|
|
t7_restart#p#p0#sp#s1.isl
|
|
t7_restart#p#p1#sp#s2.isl
|
|
t7_restart#p#p1#sp#s3.isl
|
|
t7_restart.frm
|
|
t7_restart.par
|
|
---- MYSQL_TMP_DIR/alt_dir
|
|
test
|
|
---- MYSQL_TMP_DIR/alt_dir/test
|
|
t5_restart.ibd
|
|
t6_restart#p#p0.ibd
|
|
t6_restart#p#p1.ibd
|
|
t6_restart#p#p2.ibd
|
|
t7_restart#p#p0#sp#s0.ibd
|
|
t7_restart#p#p0#sp#s1.ibd
|
|
t7_restart#p#p1#sp#s2.ibd
|
|
t7_restart#p#p1#sp#s3.ibd
|
|
#
|
|
# Start the server and show that tables are still visible and accessible.
|
|
#
|
|
SHOW VARIABLES LIKE 'innodb_file_per_table';
|
|
Variable_name Value
|
|
innodb_file_per_table ON
|
|
SHOW CREATE TABLE t1_restart;
|
|
Table Create Table
|
|
t1_restart CREATE TABLE `t1_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
|
|
SHOW CREATE TABLE t2_restart;
|
|
Table Create Table
|
|
t2_restart CREATE TABLE `t2_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
|
SHOW CREATE TABLE t3_restart;
|
|
Table Create Table
|
|
t3_restart CREATE TABLE `t3_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
SHOW CREATE TABLE t4_restart;
|
|
Table Create Table
|
|
t4_restart CREATE TABLE `t4_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
SHOW CREATE TABLE t5_restart;
|
|
Table Create Table
|
|
t5_restart CREATE TABLE `t5_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
|
|
SHOW CREATE TABLE t6_restart;
|
|
Table Create Table
|
|
t6_restart CREATE TABLE `t6_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
PARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
|
|
SHOW CREATE TABLE t7_restart;
|
|
Table Create Table
|
|
t7_restart CREATE TABLE `t7_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE (`c1`)
|
|
SUBPARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` VALUES LESS THAN (10)
|
|
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
|
|
PARTITION `p1` VALUES LESS THAN MAXVALUE
|
|
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
|
|
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart);
|
|
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart);
|
|
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart);
|
|
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
|
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
|
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart);
|
|
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart);
|
|
SELECT count(*) FROM t1_restart;
|
|
count(*)
|
|
32
|
|
SELECT count(*) FROM t2_restart;
|
|
count(*)
|
|
32
|
|
SELECT count(*) FROM t3_restart;
|
|
count(*)
|
|
32
|
|
SELECT count(*) FROM t4_restart;
|
|
count(*)
|
|
32
|
|
SELECT count(*) FROM t5_restart;
|
|
count(*)
|
|
32
|
|
SELECT count(*) FROM t6_restart;
|
|
count(*)
|
|
32
|
|
SELECT count(*) FROM t7_restart;
|
|
count(*)
|
|
32
|
|
#
|
|
# Show these tables in information_schema.
|
|
#
|
|
=== information_schema.innodb_sys_tables and innodb_sys_tablespaces ===
|
|
Table Name Tablespace Table Flags Columns Row Format Zip Size Space Type
|
|
test/t1_restart test/t1_restart 0 8 Redundant 0 Single
|
|
test/t2_restart test/t2_restart 1 8 Compact 0 Single
|
|
test/t3_restart test/t3_restart 37 8 Compressed 2048 Single
|
|
test/t4_restart test/t4_restart 33 8 Dynamic 0 Single
|
|
test/t5_restart test/t5_restart 97 8 Dynamic 0 Single
|
|
test/t6_restart#p#p0 test/t6_restart#p#p0 101 8 Compressed 2048 Single
|
|
test/t6_restart#p#p1 test/t6_restart#p#p1 101 8 Compressed 2048 Single
|
|
test/t6_restart#p#p2 test/t6_restart#p#p2 101 8 Compressed 2048 Single
|
|
test/t7_restart#p#p0#sp#s0 test/t7_restart#p#p0#sp#s0 97 8 Dynamic 0 Single
|
|
test/t7_restart#p#p0#sp#s1 test/t7_restart#p#p0#sp#s1 97 8 Dynamic 0 Single
|
|
test/t7_restart#p#p1#sp#s2 test/t7_restart#p#p1#sp#s2 97 8 Dynamic 0 Single
|
|
test/t7_restart#p#p1#sp#s3 test/t7_restart#p#p1#sp#s3 97 8 Dynamic 0 Single
|
|
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
|
|
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
|
|
test/t1_restart Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1_restart.ibd
|
|
test/t2_restart Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2_restart.ibd
|
|
test/t3_restart Single DEFAULT 2048 Compressed MYSQLD_DATADIR/test/t3_restart.ibd
|
|
test/t4_restart Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
|
|
test/t5_restart Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd
|
|
test/t6_restart#p#p0 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd
|
|
test/t6_restart#p#p1 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd
|
|
test/t6_restart#p#p2 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd
|
|
test/t7_restart#p#p0#sp#s0 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd
|
|
test/t7_restart#p#p0#sp#s1 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd
|
|
test/t7_restart#p#p1#sp#s2 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd
|
|
test/t7_restart#p#p1#sp#s3 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd
|
|
DROP TABLE t1_restart;
|
|
DROP TABLE t2_restart;
|
|
DROP TABLE t3_restart;
|
|
#
|
|
# Truncate the remote tablespaces.
|
|
#
|
|
TRUNCATE TABLE t5_restart;
|
|
ALTER TABLE t6_restart TRUNCATE PARTITION p2;
|
|
ALTER TABLE t7_restart TRUNCATE PARTITION p1;
|
|
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
|
|
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
|
|
test/t4_restart Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
|
|
test/t6_restart#p#p0 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd
|
|
test/t6_restart#p#p1 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd
|
|
test/t7_restart#p#p0#sp#s0 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd
|
|
test/t7_restart#p#p0#sp#s1 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd
|
|
test/t5_restart Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd
|
|
test/t6_restart#p#p2 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd
|
|
test/t7_restart#p#p1#sp#s2 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd
|
|
test/t7_restart#p#p1#sp#s3 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd
|
|
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot');
|
|
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
|
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
|
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart);
|
|
SELECT count(*) FROM t5_restart;
|
|
count(*)
|
|
8
|
|
SHOW CREATE TABLE t5_restart;
|
|
Table Create Table
|
|
t5_restart CREATE TABLE `t5_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000012 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
|
|
SELECT count(*) FROM t6_restart;
|
|
count(*)
|
|
21
|
|
SHOW CREATE TABLE t6_restart;
|
|
Table Create Table
|
|
t6_restart CREATE TABLE `t6_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
PARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
|
|
SELECT count(*) FROM t7_restart;
|
|
count(*)
|
|
9
|
|
SHOW CREATE TABLE t7_restart;
|
|
Table Create Table
|
|
t7_restart CREATE TABLE `t7_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE (`c1`)
|
|
SUBPARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` VALUES LESS THAN (10)
|
|
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
|
|
PARTITION `p1` VALUES LESS THAN MAXVALUE
|
|
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
|
|
#
|
|
# Shutdown the server and make a backup of a tablespace
|
|
#
|
|
---- MYSQL_DATA_DIR/test
|
|
t4_restart.frm
|
|
t4_restart.ibd
|
|
t5_restart.frm
|
|
t5_restart.frm.bak
|
|
t5_restart.isl
|
|
t5_restart.isl.bak
|
|
t6_restart#p#p0.isl
|
|
t6_restart#p#p1.isl
|
|
t6_restart#p#p2.isl
|
|
t6_restart.frm
|
|
t6_restart.par
|
|
t7_restart#p#p0#sp#s0.isl
|
|
t7_restart#p#p0#sp#s1.isl
|
|
t7_restart#p#p1#sp#s2.isl
|
|
t7_restart#p#p1#sp#s3.isl
|
|
t7_restart.frm
|
|
t7_restart.par
|
|
---- MYSQL_TMP_DIR/alt_dir/test
|
|
t5_restart.ibd
|
|
t5_restart.ibd.bak
|
|
t6_restart#p#p0.ibd
|
|
t6_restart#p#p1.ibd
|
|
t6_restart#p#p2.ibd
|
|
t7_restart#p#p0#sp#s0.ibd
|
|
t7_restart#p#p0#sp#s1.ibd
|
|
t7_restart#p#p1#sp#s2.ibd
|
|
t7_restart#p#p1#sp#s3.ibd
|
|
#
|
|
# Start the server and show the tablespaces.
|
|
#
|
|
SHOW VARIABLES LIKE 'innodb_file_per_table';
|
|
Variable_name Value
|
|
innodb_file_per_table ON
|
|
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
|
|
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
|
|
test/t4_restart Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
|
|
test/t6_restart#p#p0 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd
|
|
test/t6_restart#p#p1 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd
|
|
test/t7_restart#p#p0#sp#s0 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd
|
|
test/t7_restart#p#p0#sp#s1 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd
|
|
test/t5_restart Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd
|
|
test/t6_restart#p#p2 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd
|
|
test/t7_restart#p#p1#sp#s2 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd
|
|
test/t7_restart#p#p1#sp#s3 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd
|
|
SELECT count(*) FROM t5_restart;
|
|
count(*)
|
|
8
|
|
SHOW CREATE TABLE t5_restart;
|
|
Table Create Table
|
|
t5_restart CREATE TABLE `t5_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000009 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
|
|
SELECT count(*) FROM t6_restart;
|
|
count(*)
|
|
21
|
|
SHOW CREATE TABLE t6_restart;
|
|
Table Create Table
|
|
t6_restart CREATE TABLE `t6_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
PARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
|
|
SELECT count(*) FROM t7_restart;
|
|
count(*)
|
|
9
|
|
SHOW CREATE TABLE t7_restart;
|
|
Table Create Table
|
|
t7_restart CREATE TABLE `t7_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE (`c1`)
|
|
SUBPARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` VALUES LESS THAN (10)
|
|
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
|
|
PARTITION `p1` VALUES LESS THAN MAXVALUE
|
|
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
|
|
#
|
|
# Try to rename a tablespace to a file that already exists
|
|
#
|
|
RENAME TABLE t5_restart TO t55_restart;
|
|
ERROR 42S01: Table 't55_restart' already exists
|
|
RENAME TABLE t5_restart TO t55_restart;
|
|
ERROR HY000: Error on rename of './test/t5_restart' to './test/t55_restart' (errno: 184 "Tablespace already exists")
|
|
---- MYSQL_DATA_DIR/test
|
|
t4_restart.frm
|
|
t4_restart.ibd
|
|
t5_restart.frm
|
|
t5_restart.isl
|
|
t6_restart#p#p0.isl
|
|
t6_restart#p#p1.isl
|
|
t6_restart#p#p2.isl
|
|
t6_restart.frm
|
|
t6_restart.par
|
|
t7_restart#p#p0#sp#s0.isl
|
|
t7_restart#p#p0#sp#s1.isl
|
|
t7_restart#p#p1#sp#s2.isl
|
|
t7_restart#p#p1#sp#s3.isl
|
|
t7_restart.frm
|
|
t7_restart.par
|
|
---- MYSQL_TMP_DIR/alt_dir/test
|
|
t5_restart.ibd
|
|
t6_restart#p#p0.ibd
|
|
t6_restart#p#p1.ibd
|
|
t6_restart#p#p2.ibd
|
|
t7_restart#p#p0#sp#s0.ibd
|
|
t7_restart#p#p0#sp#s1.ibd
|
|
t7_restart#p#p1#sp#s2.ibd
|
|
t7_restart#p#p1#sp#s3.ibd
|
|
#
|
|
# Rename file table and tablespace
|
|
#
|
|
RENAME TABLE t5_restart TO t55_restart;
|
|
RENAME TABLE t6_restart TO t66_restart;
|
|
RENAME TABLE t7_restart TO t77_restart;
|
|
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
|
|
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
|
|
test/t4_restart Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
|
|
test/t66_restart#p#p0 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd
|
|
test/t66_restart#p#p1 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd
|
|
test/t77_restart#p#p0#sp#s0 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s0.ibd
|
|
test/t77_restart#p#p0#sp#s1 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s1.ibd
|
|
test/t55_restart Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
|
|
test/t66_restart#p#p2 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd
|
|
test/t77_restart#p#p1#sp#s2 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s2.ibd
|
|
test/t77_restart#p#p1#sp#s3 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s3.ibd
|
|
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
|
|
SELECT count(*) FROM t55_restart;
|
|
count(*)
|
|
16
|
|
SHOW CREATE TABLE t55_restart;
|
|
Table Create Table
|
|
t55_restart CREATE TABLE `t55_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000024 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
|
|
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
|
|
SELECT count(*) FROM t66_restart;
|
|
count(*)
|
|
42
|
|
SHOW CREATE TABLE t66_restart;
|
|
Table Create Table
|
|
t66_restart CREATE TABLE `t66_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
PARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
|
|
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
|
|
SELECT count(*) FROM t77_restart;
|
|
count(*)
|
|
18
|
|
SHOW CREATE TABLE t77_restart;
|
|
Table Create Table
|
|
t77_restart CREATE TABLE `t77_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE (`c1`)
|
|
SUBPARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` VALUES LESS THAN (10)
|
|
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
|
|
PARTITION `p1` VALUES LESS THAN MAXVALUE
|
|
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
|
|
---- MYSQL_DATA_DIR/test
|
|
t4_restart.frm
|
|
t4_restart.ibd
|
|
t55_restart.frm
|
|
t55_restart.isl
|
|
t66_restart#p#p0.isl
|
|
t66_restart#p#p1.isl
|
|
t66_restart#p#p2.isl
|
|
t66_restart.frm
|
|
t66_restart.par
|
|
t77_restart#p#p0#sp#s0.isl
|
|
t77_restart#p#p0#sp#s1.isl
|
|
t77_restart#p#p1#sp#s2.isl
|
|
t77_restart#p#p1#sp#s3.isl
|
|
t77_restart.frm
|
|
t77_restart.par
|
|
---- MYSQL_TMP_DIR/alt_dir/test
|
|
t55_restart.ibd
|
|
t66_restart#p#p0.ibd
|
|
t66_restart#p#p1.ibd
|
|
t66_restart#p#p2.ibd
|
|
t77_restart#p#p0#sp#s0.ibd
|
|
t77_restart#p#p0#sp#s1.ibd
|
|
t77_restart#p#p1#sp#s2.ibd
|
|
t77_restart#p#p1#sp#s3.ibd
|
|
#
|
|
# Restart the server
|
|
#
|
|
SHOW VARIABLES LIKE 'innodb_file_per_table';
|
|
Variable_name Value
|
|
innodb_file_per_table ON
|
|
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
|
|
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
|
|
test/t4_restart Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
|
|
test/t66_restart#p#p0 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd
|
|
test/t66_restart#p#p1 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd
|
|
test/t77_restart#p#p0#sp#s0 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s0.ibd
|
|
test/t77_restart#p#p0#sp#s1 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s1.ibd
|
|
test/t55_restart Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd
|
|
test/t66_restart#p#p2 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd
|
|
test/t77_restart#p#p1#sp#s2 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s2.ibd
|
|
test/t77_restart#p#p1#sp#s3 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s3.ibd
|
|
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
|
|
SELECT count(*) FROM t55_restart;
|
|
count(*)
|
|
32
|
|
SHOW CREATE TABLE t55_restart;
|
|
Table Create Table
|
|
t55_restart CREATE TABLE `t55_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000048 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/'
|
|
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
|
|
SELECT count(*) FROM t66_restart;
|
|
count(*)
|
|
84
|
|
SHOW CREATE TABLE t66_restart;
|
|
Table Create Table
|
|
t66_restart CREATE TABLE `t66_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
PARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)
|
|
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
|
|
SELECT count(*) FROM t77_restart;
|
|
count(*)
|
|
36
|
|
SHOW CREATE TABLE t77_restart;
|
|
Table Create Table
|
|
t77_restart CREATE TABLE `t77_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE (`c1`)
|
|
SUBPARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` VALUES LESS THAN (10)
|
|
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB),
|
|
PARTITION `p1` VALUES LESS THAN MAXVALUE
|
|
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB))
|
|
#
|
|
# Shutdown the server
|
|
#
|
|
#
|
|
# Move the remote tablespaces to a new location and change the ISL files
|
|
#
|
|
---- MYSQL_DATA_DIR/test
|
|
t4_restart.frm
|
|
t4_restart.ibd
|
|
t55_restart.frm
|
|
t55_restart.isl
|
|
t66_restart#p#p0.isl
|
|
t66_restart#p#p1.isl
|
|
t66_restart#p#p2.isl
|
|
t66_restart.frm
|
|
t66_restart.par
|
|
t77_restart#p#p0#sp#s0.isl
|
|
t77_restart#p#p0#sp#s1.isl
|
|
t77_restart#p#p1#sp#s2.isl
|
|
t77_restart#p#p1#sp#s3.isl
|
|
t77_restart.frm
|
|
t77_restart.par
|
|
---- MYSQL_TMP_DIR/alt_dir/test
|
|
t55_restart.ibd
|
|
t66_restart#p#p0.ibd
|
|
t66_restart#p#p1.ibd
|
|
t66_restart#p#p2.ibd
|
|
t77_restart#p#p0#sp#s0.ibd
|
|
t77_restart#p#p0#sp#s1.ibd
|
|
t77_restart#p#p1#sp#s2.ibd
|
|
t77_restart#p#p1#sp#s3.ibd
|
|
---- MYSQL_TMP_DIR/new_dir/test
|
|
# Moving tablespace 't4_restart' from MYSQL_DATA_DIR to MYSQL_TMP_DIR/new_dir
|
|
# Moving tablespace 't55_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
|
|
# Moving tablespace 't66_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
|
|
# Moving tablespace 't77_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir
|
|
---- MYSQL_DATA_DIR/test
|
|
t4_restart.frm
|
|
t4_restart.isl
|
|
t55_restart.frm
|
|
t55_restart.isl
|
|
t66_restart#p#p0.isl
|
|
t66_restart#p#p1.isl
|
|
t66_restart#p#p2.isl
|
|
t66_restart.frm
|
|
t66_restart.par
|
|
t77_restart#p#p0#sp#s0.isl
|
|
t77_restart#p#p0#sp#s1.isl
|
|
t77_restart#p#p1#sp#s2.isl
|
|
t77_restart#p#p1#sp#s3.isl
|
|
t77_restart.frm
|
|
t77_restart.par
|
|
---- MYSQL_TMP_DIR/alt_dir/test
|
|
---- MYSQL_TMP_DIR/new_dir/test
|
|
t4_restart.ibd
|
|
t55_restart.ibd
|
|
t66_restart#p#p0.ibd
|
|
t66_restart#p#p1.ibd
|
|
t66_restart#p#p2.ibd
|
|
t77_restart#p#p0#sp#s0.ibd
|
|
t77_restart#p#p0#sp#s1.ibd
|
|
t77_restart#p#p1#sp#s2.ibd
|
|
t77_restart#p#p1#sp#s3.ibd
|
|
#
|
|
# Start the server and check tablespaces.
|
|
#
|
|
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
|
|
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
|
|
test/t4_restart Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd
|
|
test/t66_restart#p#p0 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p0.ibd
|
|
test/t66_restart#p#p1 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p1.ibd
|
|
test/t77_restart#p#p0#sp#s0 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p0#sp#s0.ibd
|
|
test/t77_restart#p#p0#sp#s1 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p0#sp#s1.ibd
|
|
test/t55_restart Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd
|
|
test/t66_restart#p#p2 Single DEFAULT DEFAULT Compressed MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p2.ibd
|
|
test/t77_restart#p#p1#sp#s2 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p1#sp#s2.ibd
|
|
test/t77_restart#p#p1#sp#s3 Single DEFAULT DEFAULT Dynamic MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p1#sp#s3.ibd
|
|
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
|
SELECT count(*) FROM t4_restart;
|
|
count(*)
|
|
64
|
|
SHOW CREATE TABLE t4_restart;
|
|
Table Create Table
|
|
t4_restart CREATE TABLE `t4_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000099 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/new_dir/'
|
|
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
|
|
SELECT count(*) FROM t55_restart;
|
|
count(*)
|
|
64
|
|
SHOW CREATE TABLE t55_restart;
|
|
Table Create Table
|
|
t55_restart CREATE TABLE `t55_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000096 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/new_dir/'
|
|
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
|
|
SELECT count(*) FROM t66_restart;
|
|
count(*)
|
|
168
|
|
SHOW CREATE TABLE t66_restart;
|
|
Table Create Table
|
|
t66_restart CREATE TABLE `t66_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
PARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB,
|
|
PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB,
|
|
PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB)
|
|
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
|
|
SELECT count(*) FROM t77_restart;
|
|
count(*)
|
|
72
|
|
SHOW CREATE TABLE t77_restart;
|
|
Table Create Table
|
|
t77_restart CREATE TABLE `t77_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE (`c1`)
|
|
SUBPARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` VALUES LESS THAN (10)
|
|
(SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB),
|
|
PARTITION `p1` VALUES LESS THAN MAXVALUE
|
|
(SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB,
|
|
SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB))
|
|
#
|
|
# Shutdown the server
|
|
#
|
|
#
|
|
# Move the remote tablespaces back to the default datadir and delete the ISL file.
|
|
#
|
|
---- MYSQL_DATA_DIR/test
|
|
t4_restart.frm
|
|
t4_restart.isl
|
|
t55_restart.frm
|
|
t55_restart.isl
|
|
t66_restart#p#p0.isl
|
|
t66_restart#p#p1.isl
|
|
t66_restart#p#p2.isl
|
|
t66_restart.frm
|
|
t66_restart.par
|
|
t77_restart#p#p0#sp#s0.isl
|
|
t77_restart#p#p0#sp#s1.isl
|
|
t77_restart#p#p1#sp#s2.isl
|
|
t77_restart#p#p1#sp#s3.isl
|
|
t77_restart.frm
|
|
t77_restart.par
|
|
---- MYSQL_TMP_DIR/new_dir/test
|
|
t4_restart.ibd
|
|
t55_restart.ibd
|
|
t66_restart#p#p0.ibd
|
|
t66_restart#p#p1.ibd
|
|
t66_restart#p#p2.ibd
|
|
t77_restart#p#p0#sp#s0.ibd
|
|
t77_restart#p#p0#sp#s1.ibd
|
|
t77_restart#p#p1#sp#s2.ibd
|
|
t77_restart#p#p1#sp#s3.ibd
|
|
# Moving 't4_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
|
|
# Moving 't55_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
|
|
# Moving 't66_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
|
|
# Moving 't77_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR
|
|
---- MYSQL_DATA_DIR/test
|
|
t4_restart.frm
|
|
t4_restart.ibd
|
|
t55_restart.frm
|
|
t55_restart.ibd
|
|
t66_restart#p#p0.ibd
|
|
t66_restart#p#p1.ibd
|
|
t66_restart#p#p2.ibd
|
|
t66_restart.frm
|
|
t66_restart.par
|
|
t77_restart#p#p0#sp#s0.ibd
|
|
t77_restart#p#p0#sp#s1.ibd
|
|
t77_restart#p#p1#sp#s2.ibd
|
|
t77_restart#p#p1#sp#s3.ibd
|
|
t77_restart.frm
|
|
t77_restart.par
|
|
---- MYSQL_TMP_DIR/new_dir/test
|
|
#
|
|
# Start the server and check tablespaces.
|
|
#
|
|
=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles ===
|
|
Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path
|
|
test/t4_restart Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4_restart.ibd
|
|
test/t66_restart#p#p0 Single DEFAULT DEFAULT Compressed MYSQLD_DATADIR/test/t66_restart#p#p0.ibd
|
|
test/t66_restart#p#p1 Single DEFAULT DEFAULT Compressed MYSQLD_DATADIR/test/t66_restart#p#p1.ibd
|
|
test/t77_restart#p#p0#sp#s0 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t77_restart#p#p0#sp#s0.ibd
|
|
test/t77_restart#p#p0#sp#s1 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t77_restart#p#p0#sp#s1.ibd
|
|
test/t55_restart Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t55_restart.ibd
|
|
test/t66_restart#p#p2 Single DEFAULT DEFAULT Compressed MYSQLD_DATADIR/test/t66_restart#p#p2.ibd
|
|
test/t77_restart#p#p1#sp#s2 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t77_restart#p#p1#sp#s2.ibd
|
|
test/t77_restart#p#p1#sp#s3 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t77_restart#p#p1#sp#s3.ibd
|
|
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart);
|
|
SELECT count(*) FROM t4_restart;
|
|
count(*)
|
|
128
|
|
SHOW CREATE TABLE t4_restart;
|
|
Table Create Table
|
|
t4_restart CREATE TABLE `t4_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000195 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart);
|
|
SELECT count(*) FROM t55_restart;
|
|
count(*)
|
|
128
|
|
SHOW CREATE TABLE t55_restart;
|
|
Table Create Table
|
|
t55_restart CREATE TABLE `t55_restart` (
|
|
`c1` double NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=1000000192 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart);
|
|
SELECT count(*) FROM t66_restart;
|
|
count(*)
|
|
336
|
|
SHOW CREATE TABLE t66_restart;
|
|
Table Create Table
|
|
t66_restart CREATE TABLE `t66_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2
|
|
PARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` ENGINE = InnoDB,
|
|
PARTITION `p1` ENGINE = InnoDB,
|
|
PARTITION `p2` ENGINE = InnoDB)
|
|
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart);
|
|
SELECT count(*) FROM t77_restart;
|
|
count(*)
|
|
144
|
|
SHOW CREATE TABLE t77_restart;
|
|
Table Create Table
|
|
t77_restart CREATE TABLE `t77_restart` (
|
|
`c1` int(11) NOT NULL AUTO_INCREMENT,
|
|
`c2` char(10) DEFAULT NULL,
|
|
`c3` varchar(100) DEFAULT NULL,
|
|
`c4` date DEFAULT NULL,
|
|
`c5` text DEFAULT NULL,
|
|
PRIMARY KEY (`c1`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
|
PARTITION BY RANGE (`c1`)
|
|
SUBPARTITION BY HASH (`c1`)
|
|
(PARTITION `p0` VALUES LESS THAN (10)
|
|
(SUBPARTITION `s0` ENGINE = InnoDB,
|
|
SUBPARTITION `s1` ENGINE = InnoDB),
|
|
PARTITION `p1` VALUES LESS THAN MAXVALUE
|
|
(SUBPARTITION `s2` ENGINE = InnoDB,
|
|
SUBPARTITION `s3` ENGINE = InnoDB))
|
|
#
|
|
# Cleanup
|
|
#
|
|
DROP TABLE t4_restart;
|
|
DROP TABLE t55_restart;
|
|
DROP TABLE t66_restart;
|
|
DROP TABLE t77_restart;
|