| 1 |
--echo # |
| 2 |
--echo # Show the limitations of using a 'dotfile' hidden directory |
| 3 |
--echo # |
| 4 |
|
| 5 |
LET $MYSQLD_DATADIR = `select @@datadir`; |
| 6 |
LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`; |
| 7 |
SET default_storage_engine=InnoDB; |
| 8 |
|
| 9 |
CREATE TABLE t1 (a INT); |
| 10 |
CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd'; |
| 11 |
|
| 12 |
--echo # Shutdown and make the another directory that is HIDDEN. |
| 13 |
--source include/shutdown_mysqld.inc |
| 14 |
--mkdir $MYSQL_TMP_DIR/.other_dir |
| 15 |
--mkdir $MYSQL_TMP_DIR/.other_dir/test |
| 16 |
|
| 17 |
--echo # Copy ibdata1, test/t1.ibd and ts1.ibd to the hidden directory. |
| 18 |
--copy_file $MYSQLD_DATADIR/ibdata1 $MYSQL_TMP_DIR/.other_dir/ibdata1 |
| 19 |
--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQL_TMP_DIR/.other_dir/test/t1.ibd |
| 20 |
--copy_file $MYSQLD_DATADIR/ts1.ibd $MYSQL_TMP_DIR/.other_dir/ts1.ibd |
| 21 |
|
| 22 |
--echo # Restart with the --innodb-directories=MYSQL_TMP_DIR |
| 23 |
--echo # The tablespaces in the hidden directory will not be scanned. |
| 24 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 25 |
LET $restart_parameters = restart:--innodb-directories=$MYSQL_TMP_DIR; |
| 26 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 27 |
--source include/start_mysqld.inc |
| 28 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 29 |
SHOW VARIABLES LIKE 'innodb_directories'; |
| 30 |
|
| 31 |
--echo # Show that tablespaces can be built in a HIDDEN directory. |
| 32 |
--echo # NOTE: This means that a tablespace can be created in a location that cannot be recovered. !!! |
| 33 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 34 |
eval CREATE TABLE t2 (a INT) DATA DIRECTORY='$MYSQL_TMP_DIR/.other_dir'; |
| 35 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 36 |
eval CREATE TABLESPACE ts2 ADD DATAFILE '$MYSQL_TMP_DIR/.other_dir/ts2.ibd'; |
| 37 |
|
| 38 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 39 |
|
| 40 |
--echo # Shutdown again. |
| 41 |
--source include/shutdown_mysqld.inc |
| 42 |
|
| 43 |
--echo # Make a copy of the new tablespaces in the datadir |
| 44 |
--copy_file $MYSQL_TMP_DIR/.other_dir/test/t2.ibd $MYSQLD_DATADIR/test/t2.ibd |
| 45 |
--copy_file $MYSQL_TMP_DIR/.other_dir/ts2.ibd $MYSQLD_DATADIR/ts2.ibd |
| 46 |
|
| 47 |
--echo # Restart again. |
| 48 |
--echo # The tablespaces in the hidden directory will not be scanned and the |
| 49 |
--echo # tablespaces originally created in the hidden directory will be marked |
| 50 |
--echo # as MOVED to the datadir. |
| 51 |
|
| 52 |
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR |
| 53 |
--source include/start_mysqld.inc |
| 54 |
|
| 55 |
--source suite/innodb/include/show_i_s_tablespaces.inc |
| 56 |
|
| 57 |
--echo # |
| 58 |
--echo # Validate the message that should have been put into the error log. |
| 59 |
--echo # |
| 60 |
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err; |
| 61 |
let SEARCH_PATTERN=Directory '.*' will not be scanned because it is a hidden directory; |
| 62 |
--source include/search_pattern.inc |
| 63 |
|
| 64 |
--echo # |
| 65 |
--echo # Cleanup |
| 66 |
--echo # |
| 67 |
DROP TABLE t1; |
| 68 |
DROP TABLE t2; |
| 69 |
DROP TABLESPACE ts1; |
| 70 |
DROP TABLESPACE ts2; |
| 71 |
--remove_file $MYSQL_TMP_DIR/.other_dir/ibdata1 |
| 72 |
--remove_file $MYSQL_TMP_DIR/.other_dir/test/t1.ibd |
| 73 |
--remove_file $MYSQL_TMP_DIR/.other_dir/test/t2.ibd |
| 74 |
--remove_file $MYSQL_TMP_DIR/.other_dir/ts1.ibd |
| 75 |
--remove_file $MYSQL_TMP_DIR/.other_dir/ts2.ibd |
| 76 |
--rmdir $MYSQL_TMP_DIR/.other_dir/test |
| 77 |
--rmdir $MYSQL_TMP_DIR/.other_dir |
| 78 |
--let $restart_parameters = restart: |
| 79 |
--source include/restart_mysqld.inc |
| 80 |
|