mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Make 'move_file' command more reliable in 3 innodb tests
The tests innodb.import_tablespace_race, innodn.restart, and innodb.innodb-wl5522 move the tablespace file between the data directory and the tmp directory specified by global environment variables. However this is risky because it's not unusual that the set tmp directory (often under /tmp) is mounted on another disk partition or device, and 'move_file' command may fail with "Errcode: 18 'Invalid cross-device link.'" For innodb.import_tablespace_race and innodb.innodb-wl5522, moving files across directories is not necessary. Modify the tests so they rename files under the same directory. For innodb.restart, instead of moving between datadir and MYSQL_TMPDIR, move the files under MYSQLTEST_VARDIR. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
This commit is contained in:
committed by
Sergei Golubchik
parent
da73db2382
commit
0cc1694e9c
@ -36,8 +36,8 @@ ALTER TABLE t NOWAIT ADD INDEX (c);
|
||||
|
||||
FLUSH TABLE t FOR EXPORT;
|
||||
--let $create= query_get_value(SHOW CREATE TABLE t, Create Table, 1)
|
||||
--copy_file $datadir/test/t.cfg $MYSQL_TMP_DIR/t.cfg
|
||||
--copy_file $datadir/test/t.ibd $MYSQL_TMP_DIR/t.ibd
|
||||
--copy_file $datadir/test/t.cfg $datadir/test/t.cfg.sav
|
||||
--copy_file $datadir/test/t.ibd $datadir/test/t.ibd.sav
|
||||
UNLOCK TABLES;
|
||||
|
||||
DROP TABLE t;
|
||||
@ -46,8 +46,8 @@ eval $create;
|
||||
--enable_query_log
|
||||
|
||||
ALTER TABLE t DISCARD TABLESPACE;
|
||||
--move_file $MYSQL_TMP_DIR/t.cfg $datadir/test/t.cfg
|
||||
--move_file $MYSQL_TMP_DIR/t.ibd $datadir/test/t.ibd
|
||||
--move_file $datadir/test/t.cfg.sav $datadir/test/t.cfg
|
||||
--move_file $datadir/test/t.ibd.sav $datadir/test/t.ibd
|
||||
ALTER TABLE t IMPORT TABLESPACE;
|
||||
|
||||
# Cleanup
|
||||
|
Reference in New Issue
Block a user