--echo # --echo # Non-Windows version of Tablespace Portability test. --echo # --echo # This testcase is related to WL#5980 & WL#6205. --echo # It tests whether datafiles can be copied from one location --echo # to another, and still be opened. In order to make this testcase run --echo # on any OS, we create the tablespaces here. --echo # # On Windows, MTR converts '\' to '/' in file names. # On other systems, '\' is left unchanged. # So this output file is different from the Windows version. --source include/not_windows.inc SET DEFAULT_STORAGE_ENGINE=InnoDB; --disable_query_log --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR LET $restart_parameters = restart:--innodb-directories=$MYSQL_TMP_DIR; --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR --source include/restart_mysqld.inc --enable_query_log --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR SHOW VARIABLES LIKE 'innodb_directories'; --echo # --echo # Try to create a tablespace in a read-only directory. --echo # # This section is does not work on Windows since it uses chmod to prevent # a file from being created in that directory. On Windows, the user is often # an Administrator who can still create files in that directory --mkdir $MYSQL_TMP_DIR/read_only_dir --chmod 0444 $MYSQL_TMP_DIR/read_only_dir --replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR --error ER_CREATE_FILEGROUP_FAILED eval CREATE TABLESPACE s7_def ADD DATAFILE '$MYSQL_TMP_DIR/read_only_dir/s7.ibd'; SHOW WARNINGS; --rmdir $MYSQL_TMP_DIR/read_only_dir --disable_query_log call mtr.add_suppression("\\[Warning\\] .* Converting backslash to forward slash in ADD DATAFILE"); call mtr.add_suppression("\\[Warning\\] .* '.*' permission error, can't delete!"); call mtr.add_suppression("\\[ERROR\\] .* The error means mysqld does not have the access rights to the directory."); call mtr.add_suppression("\\[ERROR\\] .* Cannot create file"); call mtr.add_suppression("\\[ERROR\\] .* The directory for tablespace .* does not exist or is incorrect"); call mtr.add_suppression("\\[ERROR\\] .* Cannot create tablespace .* because the directory is not a valid location. The DATAFILE location must be in a known directory"); call mtr.add_suppression("\\[ERROR\\] .* Cannot create tablespace .* because the directory is not a valid location. The DATAFILE location cannot be under the datadir"); --enable_query_log --source suite/innodb/include/tablespace_filenames.inc # There is no tablespace portabilility in mysql-trunk at the moment since ISL # files have been disabled and fil_ibd_open() only looks for a file in one place. # --source suite/innodb/include/tablespace_portability.inc --let $restart_parameters= restart: --source include/restart_mysqld.inc --echo # --echo # Bug#32721533 CAN'T ALTER TABLE AFTER MOVING THE DATA FILE USING INNODB_DIRECTORIES OPTION --echo # let MYSQLD_DATADIR= `SELECT @@datadir`; let INNODB_DIR=$MYSQLTEST_VARDIR/test; --mkdir $INNODB_DIR CREATE TABLE t1(a INT); --source include/save_error_log_position.inc --source include/shutdown_mysqld.inc --copy_file $MYSQLD_DATADIR/test/t1.ibd $INNODB_DIR/t1.ibd --remove_file $MYSQLD_DATADIR/test/t1.ibd --source include/start_mysqld.inc let $error_pattern = .*\\[Warning\\].*Tablespace .*, name 'test/t1', file '.*test.*t1.ibd' is missing; --source include/assert_error_log.inc --replace_result $INNODB_DIR INNODB_DIR --let restart_parameters="restart: --innodb_directories=$INNODB_DIR" --source include/restart_mysqld.inc ALTER TABLE t1 FORCE; DROP TABLE t1; # Clean up --let restart_parameters="restart: " --source include/restart_mysqld.inc --rmdir $INNODB_DIR