| 1 |
# |
| 2 |
# These test make sure that tables are visible after rebooting |
| 3 |
# |
| 4 |
--source include/innodb_page_size_small.inc |
| 5 |
--source include/have_partition.inc |
| 6 |
--source include/not_embedded.inc |
| 7 |
--source include/innodb_checksum_algorithm.inc |
| 8 |
--source include/have_symlink.inc |
| 9 |
--source include/test_db_charset_latin1.inc |
| 10 |
|
| 11 |
SET default_storage_engine=InnoDB; |
| 12 |
LET $MYSQLD_DATADIR = `select @@datadir`; |
| 13 |
LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`; |
| 14 |
|
| 15 |
--disable_query_log |
| 16 |
# This error is expected in the error log for this test. |
| 17 |
call mtr.add_suppression("\\[ERROR\\] InnoDB: Error number 17 means 'File exists'"); |
| 18 |
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number (17|80) in a file operation."); |
| 19 |
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot create file .*t55_restart.isl"); |
| 20 |
call mtr.add_suppression("\\[ERROR\\] InnoDB: The link file: .* already exists."); |
| 21 |
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot open datafile for read-only:"); |
| 22 |
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 2 in a file operation."); |
| 23 |
call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified."); |
| 24 |
--enable_query_log |
| 25 |
|
| 26 |
--echo # |
| 27 |
--echo # A series of tests to make sure tables are opened after restart. |
| 28 |
--echo # Bug#13357607 Compressed file-per-table tablespaces fail to open |
| 29 |
--echo # |
| 30 |
# This bug was introduced without a regression test failing since |
| 31 |
# there were no tests showing that tablespaces could be created and |
| 32 |
# then read after reboot. |
| 33 |
# |
| 34 |
|
| 35 |
--disable_query_log |
| 36 |
let $MYSQL_DATA_DIR= `select @@datadir`; |
| 37 |
let $data_directory = DATA DIRECTORY='$MYSQL_TMP_DIR/alt_dir'; |
| 38 |
--enable_query_log |
| 39 |
|
| 40 |
--echo # |
| 41 |
--echo # Create and insert records into a REDUNDANT row formatted table. |
| 42 |
--echo # |
| 43 |
CREATE TABLE t1_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) |
| 44 |
ROW_FORMAT=REDUNDANT ENGINE=InnoDB; |
| 45 |
INSERT INTO t1_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); |
| 46 |
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); |
| 47 |
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); |
| 48 |
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); |
| 49 |
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); |
| 50 |
SHOW CREATE TABLE t1_restart; |
| 51 |
SELECT count(*) FROM t1_restart; |
| 52 |
|
| 53 |
--echo # |
| 54 |
--echo # Create and insert records into a COMPACT row formatted table. |
| 55 |
--echo # |
| 56 |
CREATE TABLE t2_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) |
| 57 |
ROW_FORMAT=COMPACT ENGINE=InnoDB; |
| 58 |
INSERT INTO t2_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); |
| 59 |
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); |
| 60 |
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); |
| 61 |
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); |
| 62 |
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); |
| 63 |
SHOW CREATE TABLE t2_restart; |
| 64 |
SELECT count(*) FROM t2_restart; |
| 65 |
|
| 66 |
--echo # |
| 67 |
--echo # Create and insert records into a COMPRESSED row formatted table. |
| 68 |
--echo # |
| 69 |
CREATE TABLE t3_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) |
| 70 |
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB; |
| 71 |
INSERT INTO t3_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); |
| 72 |
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); |
| 73 |
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); |
| 74 |
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); |
| 75 |
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); |
| 76 |
SHOW CREATE TABLE t3_restart; |
| 77 |
SELECT count(*) FROM t3_restart; |
| 78 |
|
| 79 |
--echo # |
| 80 |
--echo # Create and insert records into a DYNAMIC row formatted table. |
| 81 |
--echo # |
| 82 |
CREATE TABLE t4_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) |
| 83 |
ROW_FORMAT=DYNAMIC ENGINE=InnoDB; |
| 84 |
INSERT INTO t4_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); |
| 85 |
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); |
| 86 |
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); |
| 87 |
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); |
| 88 |
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); |
| 89 |
SHOW CREATE TABLE t4_restart; |
| 90 |
SELECT count(*) FROM t4_restart; |
| 91 |
|
| 92 |
--echo # |
| 93 |
--echo # Create and insert records into a table that uses a remote DATA DIRECTORY. |
| 94 |
--echo # |
| 95 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 96 |
eval CREATE TABLE t5_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) |
| 97 |
ROW_FORMAT=DYNAMIC ENGINE=InnoDB $data_directory; |
| 98 |
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); |
| 99 |
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); |
| 100 |
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); |
| 101 |
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); |
| 102 |
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); |
| 103 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 104 |
SHOW CREATE TABLE t5_restart; |
| 105 |
SELECT count(*) FROM t5_restart; |
| 106 |
|
| 107 |
--echo # |
| 108 |
--echo # Create and insert records into a partitioned table that uses |
| 109 |
--echo # a remote DATA DIRECTORY for each partition. |
| 110 |
--echo # |
| 111 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 112 |
eval CREATE TABLE t6_restart( |
| 113 |
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) |
| 114 |
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB |
| 115 |
PARTITION BY HASH(c1) ( |
| 116 |
PARTITION p0 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir', |
| 117 |
PARTITION p1 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir', |
| 118 |
PARTITION p2 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir'); |
| 119 |
INSERT INTO t6_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); |
| 120 |
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); |
| 121 |
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); |
| 122 |
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); |
| 123 |
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); |
| 124 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 125 |
SHOW CREATE TABLE t6_restart; |
| 126 |
SELECT count(*) FROM t6_restart; |
| 127 |
|
| 128 |
--echo # |
| 129 |
--echo # Create and insert records into a subpartitioned table that uses |
| 130 |
--echo # a remote DATA DIRECTORY for each subpartition. |
| 131 |
--echo # |
| 132 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 133 |
eval CREATE TABLE t7_restart( |
| 134 |
c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) |
| 135 |
ROW_FORMAT=DYNAMIC ENGINE=InnoDB |
| 136 |
PARTITION BY RANGE(c1) SUBPARTITION BY HASH(c1) ( |
| 137 |
PARTITION p0 VALUES LESS THAN (10) ( |
| 138 |
SUBPARTITION s0 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir', |
| 139 |
SUBPARTITION s1 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir'), |
| 140 |
PARTITION p1 VALUES LESS THAN MAXVALUE ( |
| 141 |
SUBPARTITION s2 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir', |
| 142 |
SUBPARTITION s3 DATA DIRECTORY = '$MYSQL_TMP_DIR/alt_dir')); |
| 143 |
INSERT INTO t7_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); |
| 144 |
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); |
| 145 |
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); |
| 146 |
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); |
| 147 |
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); |
| 148 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 149 |
SHOW CREATE TABLE t7_restart; |
| 150 |
SELECT count(*) FROM t7_restart; |
| 151 |
|
| 152 |
--echo # |
| 153 |
--echo # Show these tables in information_schema. |
| 154 |
--echo # |
| 155 |
--source suite/innodb/include/show_i_s_tables.inc |
| 156 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 157 |
|
| 158 |
--echo # |
| 159 |
--echo # Shutdown the server and list the tablespace OS files |
| 160 |
--echo # |
| 161 |
--source include/shutdown_mysqld.inc |
| 162 |
|
| 163 |
--echo ---- MYSQL_DATA_DIR/test |
| 164 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test |
| 165 |
--replace_result #P# #p# #SP# #sp# |
| 166 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 167 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 168 |
--echo ---- MYSQL_TMP_DIR/alt_dir |
| 169 |
--list_files $MYSQL_TMP_DIR/alt_dir |
| 170 |
--echo ---- MYSQL_TMP_DIR/alt_dir/test |
| 171 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/alt_dir/test |
| 172 |
--replace_result #P# #p# #SP# #sp# |
| 173 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 174 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 175 |
|
| 176 |
--echo # |
| 177 |
--echo # Start the server and show that tables are still visible and accessible. |
| 178 |
--echo # |
| 179 |
--source include/start_mysqld.inc |
| 180 |
|
| 181 |
SHOW CREATE TABLE t1_restart; |
| 182 |
SHOW CREATE TABLE t2_restart; |
| 183 |
SHOW CREATE TABLE t3_restart; |
| 184 |
SHOW CREATE TABLE t4_restart; |
| 185 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 186 |
SHOW CREATE TABLE t5_restart; |
| 187 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 188 |
SHOW CREATE TABLE t6_restart; |
| 189 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 190 |
SHOW CREATE TABLE t7_restart; |
| 191 |
|
| 192 |
INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); |
| 193 |
INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); |
| 194 |
INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); |
| 195 |
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); |
| 196 |
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); |
| 197 |
INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); |
| 198 |
INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); |
| 199 |
|
| 200 |
SELECT count(*) FROM t1_restart; |
| 201 |
SELECT count(*) FROM t2_restart; |
| 202 |
SELECT count(*) FROM t3_restart; |
| 203 |
SELECT count(*) FROM t4_restart; |
| 204 |
SELECT count(*) FROM t5_restart; |
| 205 |
SELECT count(*) FROM t6_restart; |
| 206 |
SELECT count(*) FROM t7_restart; |
| 207 |
|
| 208 |
--echo # |
| 209 |
--echo # Show these tables in information_schema. |
| 210 |
--echo # |
| 211 |
--source suite/innodb/include/show_i_s_tables.inc |
| 212 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 213 |
|
| 214 |
DROP TABLE t1_restart; |
| 215 |
DROP TABLE t2_restart; |
| 216 |
DROP TABLE t3_restart; |
| 217 |
# Tablespace for t4_restart will be moved later from default directory to a new directory |
| 218 |
# and an ISL file will be created not using InnoDB. |
| 219 |
# Table t5_restart will be expanded. |
| 220 |
# Tables t6_restart and t7_restart will be truncated. |
| 221 |
|
| 222 |
--echo # |
| 223 |
--echo # Truncate the remote tablespaces. |
| 224 |
--echo # |
| 225 |
TRUNCATE TABLE t5_restart; |
| 226 |
ALTER TABLE t6_restart TRUNCATE PARTITION p2; |
| 227 |
ALTER TABLE t7_restart TRUNCATE PARTITION p1; |
| 228 |
|
| 229 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 230 |
|
| 231 |
INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); |
| 232 |
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); |
| 233 |
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); |
| 234 |
INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); |
| 235 |
|
| 236 |
SELECT count(*) FROM t5_restart; |
| 237 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 238 |
SHOW CREATE TABLE t5_restart; |
| 239 |
|
| 240 |
SELECT count(*) FROM t6_restart; |
| 241 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 242 |
SHOW CREATE TABLE t6_restart; |
| 243 |
|
| 244 |
SELECT count(*) FROM t7_restart; |
| 245 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 246 |
SHOW CREATE TABLE t7_restart; |
| 247 |
|
| 248 |
--echo # |
| 249 |
--echo # Shutdown the server and make a backup of a tablespace |
| 250 |
--echo # |
| 251 |
--source include/shutdown_mysqld.inc |
| 252 |
|
| 253 |
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd.bak |
| 254 |
--copy_file $MYSQL_DATA_DIR/test/t5_restart.isl $MYSQL_DATA_DIR/test/t5_restart.isl.bak |
| 255 |
--copy_file $MYSQL_DATA_DIR/test/t5_restart.frm $MYSQL_DATA_DIR/test/t5_restart.frm.bak |
| 256 |
|
| 257 |
--echo ---- MYSQL_DATA_DIR/test |
| 258 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test |
| 259 |
--replace_result #P# #p# #SP# #sp# |
| 260 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 261 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 262 |
--echo ---- MYSQL_TMP_DIR/alt_dir/test |
| 263 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/alt_dir/test |
| 264 |
--replace_result #P# #p# #SP# #sp# |
| 265 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 266 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 267 |
|
| 268 |
--echo # |
| 269 |
--echo # Start the server and show the tablespaces. |
| 270 |
--echo # |
| 271 |
--source include/start_mysqld.inc |
| 272 |
|
| 273 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 274 |
|
| 275 |
SELECT count(*) FROM t5_restart; |
| 276 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 277 |
SHOW CREATE TABLE t5_restart; |
| 278 |
|
| 279 |
SELECT count(*) FROM t6_restart; |
| 280 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 281 |
SHOW CREATE TABLE t6_restart; |
| 282 |
|
| 283 |
SELECT count(*) FROM t7_restart; |
| 284 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 285 |
SHOW CREATE TABLE t7_restart; |
| 286 |
|
| 287 |
--echo # |
| 288 |
--echo # Try to rename a tablespace to a file that already exists |
| 289 |
--echo # |
| 290 |
|
| 291 |
--copy_file $MYSQL_DATA_DIR/test/t5_restart.frm.bak $MYSQL_DATA_DIR/test/t55_restart.frm |
| 292 |
--error ER_TABLE_EXISTS_ERROR |
| 293 |
RENAME TABLE t5_restart TO t55_restart; |
| 294 |
--remove_file $MYSQL_DATA_DIR/test/t55_restart.frm |
| 295 |
--remove_file $MYSQL_DATA_DIR/test/t5_restart.frm.bak |
| 296 |
|
| 297 |
--copy_file $MYSQL_DATA_DIR/test/t5_restart.isl.bak $MYSQL_DATA_DIR/test/t55_restart.isl |
| 298 |
--error ER_ERROR_ON_RENAME |
| 299 |
RENAME TABLE t5_restart TO t55_restart; |
| 300 |
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl |
| 301 |
--remove_file $MYSQL_DATA_DIR/test/t5_restart.isl.bak |
| 302 |
|
| 303 |
#--copy_file $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd.bak $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd |
| 304 |
# This RENAME TABLE works of Linux but gets ER_ERROR_ON_RENAME on Windows |
| 305 |
#--error ER_ERROR_ON_RENAME |
| 306 |
#RENAME TABLE t5_restart TO t55_restart; |
| 307 |
#--remove_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd |
| 308 |
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd.bak |
| 309 |
|
| 310 |
--echo ---- MYSQL_DATA_DIR/test |
| 311 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test |
| 312 |
--replace_result #P# #p# #SP# #sp# |
| 313 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 314 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 315 |
--echo ---- MYSQL_TMP_DIR/alt_dir/test |
| 316 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/alt_dir/test |
| 317 |
--replace_result #P# #p# #SP# #sp# |
| 318 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 319 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 320 |
|
| 321 |
--echo # |
| 322 |
--echo # Rename file table and tablespace |
| 323 |
--echo # |
| 324 |
|
| 325 |
RENAME TABLE t5_restart TO t55_restart; |
| 326 |
RENAME TABLE t6_restart TO t66_restart; |
| 327 |
RENAME TABLE t7_restart TO t77_restart; |
| 328 |
|
| 329 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 330 |
|
| 331 |
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); |
| 332 |
SELECT count(*) FROM t55_restart; |
| 333 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 334 |
SHOW CREATE TABLE t55_restart; |
| 335 |
|
| 336 |
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart); |
| 337 |
SELECT count(*) FROM t66_restart; |
| 338 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 339 |
SHOW CREATE TABLE t66_restart; |
| 340 |
|
| 341 |
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); |
| 342 |
SELECT count(*) FROM t77_restart; |
| 343 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 344 |
SHOW CREATE TABLE t77_restart; |
| 345 |
|
| 346 |
--echo ---- MYSQL_DATA_DIR/test |
| 347 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test |
| 348 |
--replace_result #P# #p# #SP# #sp# |
| 349 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 350 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 351 |
--echo ---- MYSQL_TMP_DIR/alt_dir/test |
| 352 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/alt_dir/test |
| 353 |
--replace_result #P# #p# #SP# #sp# |
| 354 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 355 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 356 |
|
| 357 |
--echo # |
| 358 |
--echo # Restart the server |
| 359 |
--echo # |
| 360 |
--source include/restart_mysqld.inc |
| 361 |
|
| 362 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 363 |
|
| 364 |
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); |
| 365 |
SELECT count(*) FROM t55_restart; |
| 366 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 367 |
SHOW CREATE TABLE t55_restart; |
| 368 |
|
| 369 |
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart); |
| 370 |
SELECT count(*) FROM t66_restart; |
| 371 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 372 |
SHOW CREATE TABLE t66_restart; |
| 373 |
|
| 374 |
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); |
| 375 |
SELECT count(*) FROM t77_restart; |
| 376 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 377 |
SHOW CREATE TABLE t77_restart; |
| 378 |
|
| 379 |
--echo # |
| 380 |
--echo # Shutdown the server |
| 381 |
--echo # |
| 382 |
--source include/shutdown_mysqld.inc |
| 383 |
|
| 384 |
--echo # |
| 385 |
--echo # Move the remote tablespaces to a new location and change the ISL files |
| 386 |
--echo # |
| 387 |
--mkdir $MYSQL_TMP_DIR/new_dir |
| 388 |
--mkdir $MYSQL_TMP_DIR/new_dir/test |
| 389 |
--echo ---- MYSQL_DATA_DIR/test |
| 390 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test |
| 391 |
--replace_result #P# #p# #SP# #sp# |
| 392 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 393 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 394 |
--echo ---- MYSQL_TMP_DIR/alt_dir/test |
| 395 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/alt_dir/test |
| 396 |
--replace_result #P# #p# #SP# #sp# |
| 397 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 398 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 399 |
--echo ---- MYSQL_TMP_DIR/new_dir/test |
| 400 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/new_dir/test |
| 401 |
--replace_result #P# #p# #SP# #sp# |
| 402 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 403 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 404 |
|
| 405 |
--echo # Moving tablespace 't4_restart' from MYSQL_DATA_DIR to MYSQL_TMP_DIR/new_dir |
| 406 |
--copy_file $MYSQL_DATA_DIR/test/t4_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd |
| 407 |
--remove_file $MYSQL_DATA_DIR/test/t4_restart.ibd |
| 408 |
--write_line $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd $MYSQL_DATA_DIR/test/t4_restart.isl |
| 409 |
|
| 410 |
--echo # Moving tablespace 't55_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir |
| 411 |
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd |
| 412 |
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd |
| 413 |
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl |
| 414 |
--write_line $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd $MYSQL_DATA_DIR/test/t55_restart.isl |
| 415 |
|
| 416 |
--echo # Moving tablespace 't66_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir |
| 417 |
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p0.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd |
| 418 |
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p1.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd |
| 419 |
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p2.ibd $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd |
| 420 |
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p0.ibd |
| 421 |
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p1.ibd |
| 422 |
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t66_restart#P#p2.ibd |
| 423 |
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl |
| 424 |
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl |
| 425 |
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl |
| 426 |
--write_line $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl |
| 427 |
--write_line $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl |
| 428 |
--write_line $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl |
| 429 |
|
| 430 |
--echo # Moving tablespace 't77_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir |
| 431 |
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd |
| 432 |
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s1.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd |
| 433 |
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s2.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd |
| 434 |
--copy_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s3.ibd $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd |
| 435 |
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s0.ibd |
| 436 |
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p0#SP#s1.ibd |
| 437 |
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s2.ibd |
| 438 |
--remove_file $MYSQL_TMP_DIR/alt_dir/test/t77_restart#P#p1#SP#s3.ibd |
| 439 |
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl |
| 440 |
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl |
| 441 |
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl |
| 442 |
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl |
| 443 |
--write_line $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl |
| 444 |
--write_line $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl |
| 445 |
--write_line $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl |
| 446 |
--write_line $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl |
| 447 |
|
| 448 |
--echo ---- MYSQL_DATA_DIR/test |
| 449 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test |
| 450 |
--replace_result #P# #p# #SP# #sp# |
| 451 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 452 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 453 |
--echo ---- MYSQL_TMP_DIR/alt_dir/test |
| 454 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/alt_dir/test |
| 455 |
--replace_result #P# #p# #SP# #sp# |
| 456 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 457 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 458 |
--echo ---- MYSQL_TMP_DIR/new_dir/test |
| 459 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/new_dir/test |
| 460 |
--replace_result #P# #p# #SP# #sp# |
| 461 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 462 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 463 |
|
| 464 |
--echo # |
| 465 |
--echo # Start the server and check tablespaces. |
| 466 |
--echo # |
| 467 |
--source include/start_mysqld.inc |
| 468 |
|
| 469 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 470 |
|
| 471 |
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); |
| 472 |
SELECT count(*) FROM t4_restart; |
| 473 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 474 |
SHOW CREATE TABLE t4_restart; |
| 475 |
|
| 476 |
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); |
| 477 |
SELECT count(*) FROM t55_restart; |
| 478 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 479 |
SHOW CREATE TABLE t55_restart; |
| 480 |
|
| 481 |
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart); |
| 482 |
SELECT count(*) FROM t66_restart; |
| 483 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 484 |
SHOW CREATE TABLE t66_restart; |
| 485 |
|
| 486 |
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); |
| 487 |
SELECT count(*) FROM t77_restart; |
| 488 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 489 |
SHOW CREATE TABLE t77_restart; |
| 490 |
|
| 491 |
|
| 492 |
--echo # |
| 493 |
--echo # Shutdown the server |
| 494 |
--echo # |
| 495 |
--source include/shutdown_mysqld.inc |
| 496 |
|
| 497 |
--echo # |
| 498 |
--echo # Move the remote tablespaces back to the default datadir and delete the ISL file. |
| 499 |
--echo # |
| 500 |
|
| 501 |
--echo ---- MYSQL_DATA_DIR/test |
| 502 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test |
| 503 |
--replace_result #P# #p# #SP# #sp# |
| 504 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 505 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 506 |
--echo ---- MYSQL_TMP_DIR/new_dir/test |
| 507 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/new_dir/test |
| 508 |
--replace_result #P# #p# #SP# #sp# |
| 509 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 510 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 511 |
|
| 512 |
--echo # Moving 't4_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR |
| 513 |
--copy_file $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd $MYSQL_DATA_DIR/test/t4_restart.ibd |
| 514 |
--remove_file $MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd |
| 515 |
--remove_file $MYSQL_DATA_DIR/test/t4_restart.isl |
| 516 |
|
| 517 |
--echo # Moving 't55_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR |
| 518 |
--copy_file $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd $MYSQL_DATA_DIR/test/t55_restart.ibd |
| 519 |
--remove_file $MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd |
| 520 |
--remove_file $MYSQL_DATA_DIR/test/t55_restart.isl |
| 521 |
|
| 522 |
--echo # Moving 't66_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR |
| 523 |
--copy_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p0.ibd |
| 524 |
--copy_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p1.ibd |
| 525 |
--copy_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd $MYSQL_DATA_DIR/test/t66_restart#P#p2.ibd |
| 526 |
--remove_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p0.ibd |
| 527 |
--remove_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p1.ibd |
| 528 |
--remove_file $MYSQL_TMP_DIR/new_dir/test/t66_restart#P#p2.ibd |
| 529 |
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p0.isl |
| 530 |
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p1.isl |
| 531 |
--remove_file $MYSQL_DATA_DIR/test/t66_restart#P#p2.isl |
| 532 |
|
| 533 |
--echo # Moving 't77_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR |
| 534 |
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.ibd |
| 535 |
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.ibd |
| 536 |
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.ibd |
| 537 |
--copy_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.ibd |
| 538 |
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s0.ibd |
| 539 |
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p0#SP#s1.ibd |
| 540 |
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s2.ibd |
| 541 |
--remove_file $MYSQL_TMP_DIR/new_dir/test/t77_restart#P#p1#SP#s3.ibd |
| 542 |
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s0.isl |
| 543 |
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p0#SP#s1.isl |
| 544 |
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s2.isl |
| 545 |
--remove_file $MYSQL_DATA_DIR/test/t77_restart#P#p1#SP#s3.isl |
| 546 |
|
| 547 |
--echo ---- MYSQL_DATA_DIR/test |
| 548 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_DATA_DIR/test |
| 549 |
--replace_result #P# #p# #SP# #sp# |
| 550 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 551 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 552 |
--echo ---- MYSQL_TMP_DIR/new_dir/test |
| 553 |
--list_files_write_file $MYSQLD_DATADIR.files.txt $MYSQL_TMP_DIR/new_dir/test |
| 554 |
--replace_result #P# #p# #SP# #sp# |
| 555 |
--cat_file $MYSQLD_DATADIR.files.txt |
| 556 |
--remove_file $MYSQLD_DATADIR.files.txt |
| 557 |
|
| 558 |
--echo # |
| 559 |
--echo # Start the server and check tablespaces. |
| 560 |
--echo # |
| 561 |
-- source include/start_mysqld.inc |
| 562 |
|
| 563 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 564 |
|
| 565 |
INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); |
| 566 |
SELECT count(*) FROM t4_restart; |
| 567 |
SHOW CREATE TABLE t4_restart; |
| 568 |
|
| 569 |
INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); |
| 570 |
SELECT count(*) FROM t55_restart; |
| 571 |
SHOW CREATE TABLE t55_restart; |
| 572 |
|
| 573 |
INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart); |
| 574 |
SELECT count(*) FROM t66_restart; |
| 575 |
SHOW CREATE TABLE t66_restart; |
| 576 |
|
| 577 |
INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); |
| 578 |
SELECT count(*) FROM t77_restart; |
| 579 |
SHOW CREATE TABLE t77_restart; |
| 580 |
|
| 581 |
|
| 582 |
--echo # |
| 583 |
--echo # Cleanup |
| 584 |
--echo # |
| 585 |
|
| 586 |
DROP TABLE t4_restart; |
| 587 |
DROP TABLE t55_restart; |
| 588 |
DROP TABLE t66_restart; |
| 589 |
DROP TABLE t77_restart; |
| 590 |
|
| 591 |
--rmdir $MYSQL_TMP_DIR/alt_dir/test |
| 592 |
--rmdir $MYSQL_TMP_DIR/alt_dir |
| 593 |
--rmdir $MYSQL_TMP_DIR/new_dir/test |
| 594 |
--rmdir $MYSQL_TMP_DIR/new_dir |
| 595 |
--source include/test_db_charset_restore.inc |