Commit 89633995 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-16678: Actually ignore #sql-ib tables

Apparently, regular expression operations that remove entire lines
of output do not work with list_files, and hence the adjustments in
commit 1c282d4b were ineffective.

For cat_file (preceded by list_files_write_file) the replace_regex
does work.

For some reason, for suite/parts/inc/partition_crash_exchange.inc
some file names will be lost when using list_files_write_file
instead of list_files.

We use a precise pattern match. dict_mem_create_temporary_tablename()
is generating #sql-ib names followed by decimal digits only.
parent 28c89b71
...@@ -98,7 +98,7 @@ call mtr.check_testcase(); ...@@ -98,7 +98,7 @@ call mtr.check_testcase();
let $datadir=`select @@datadir`; let $datadir=`select @@datadir`;
list_files $datadir mysql_upgrade_info; list_files $datadir mysql_upgrade_info;
list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*; list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*;
--replace_regex /#sql-ib[0-9a-f]+\.ibd\n// --replace_regex /#sql-ib[1-9][0-9]*\.ibd\n//
cat_file $datadir.tempfiles.txt; cat_file $datadir.tempfiles.txt;
remove_file $datadir.tempfiles.txt; remove_file $datadir.tempfiles.txt;
list_files $datadir/mysql #sql*; list_files $datadir/mysql #sql*;
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# This is a copy of innodb-alter.test except using remote tablespaces # This is a copy of innodb-alter.test except using remote tablespaces
# and showing those files. # and showing those files.
# #
SET @innodb_file_per_table_orig=@@GLOBAL.innodb_file_per_table;
SET default_storage_engine=InnoDB; SET default_storage_engine=InnoDB;
SET GLOBAL innodb_file_per_table=ON; SET GLOBAL innodb_file_per_table=ON;
SET NAMES utf8mb4; SET NAMES utf8mb4;
...@@ -1588,3 +1589,4 @@ DROP TABLE tt, t1o, sys_tables, sys_indexes, sys_foreign; ...@@ -1588,3 +1589,4 @@ DROP TABLE tt, t1o, sys_tables, sys_indexes, sys_foreign;
### files in MYSQL_DATA_DIR/test ### files in MYSQL_DATA_DIR/test
db.opt db.opt
### files in MYSQL_TMP_DIR/alt_dir/test ### files in MYSQL_TMP_DIR/alt_dir/test
SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
...@@ -3,8 +3,12 @@ ...@@ -3,8 +3,12 @@
--eval $create_statement --eval $create_statement
--eval $insert_statement --eval $insert_statement
--echo # State before crash --echo # State before crash
--list_files_write_file $DATADIR.files.txt $DATADIR/test
--replace_result #p# #P# #sp# #SP# --replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test --replace_regex /#sql-ib[1-9][0-9]*\.ibd\n//
--cat_file $DATADIR.files.txt
--remove_file $DATADIR.files.txt
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--sorted_result --sorted_result
SELECT * FROM t1; SELECT * FROM t1;
...@@ -14,14 +18,20 @@ SELECT * FROM t1; ...@@ -14,14 +18,20 @@ SELECT * FROM t1;
--error 2013 --error 2013
--eval $crash_statement --eval $crash_statement
--echo # State after crash (before recovery) --echo # State after crash (before recovery)
--replace_regex /sqlx.*\./sqlx-nnnn_nnnn./ /#p#/#P#/ /#sp#/#SP#/ /#tmp#/#TMP#/ /#sql-ib[0-9a-f]+\.ibd\n// --list_files_write_file $DATADIR.files.txt $DATADIR/test
--list_files $DATADIR/test --replace_result #p# #P# #sp# #SP# #tmp# #TMP#
--replace_regex /sqlx.*\./sqlx-nnnn_nnnn./ /#sql-ib[1-9][0-9]*\.ibd\n//
--cat_file $DATADIR.files.txt
--remove_file $DATADIR.files.txt
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect --enable_reconnect
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--echo # State after crash recovery --echo # State after crash recovery
--list_files_write_file $DATADIR.files.txt $DATADIR/test
--replace_result #p# #P# #sp# #SP# --replace_result #p# #P# #sp# #SP#
--list_files $DATADIR/test --replace_regex /#sql-ib[1-9][0-9]*\.ibd\n//
--cat_file $DATADIR.files.txt
--remove_file $DATADIR.files.txt
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--sorted_result --sorted_result
SELECT * FROM t1; SELECT * FROM t1;
......
...@@ -422,16 +422,7 @@ a b ...@@ -422,16 +422,7 @@ a b
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2; ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery) # State after crash (before recovery)
#sqlx-nnnn_nnnn.MYD #sqlx-nnnn_nnnn.frm
#sqlx-nnnn_nnnn.MYI
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p1.MYD
t1#P#p1.MYI
t1.frm
t1.par
t2.frm
# State after crash recovery # State after crash recovery
db.opt db.opt
t1#P#p0.MYD t1#P#p0.MYD
...@@ -537,16 +528,7 @@ a b ...@@ -537,16 +528,7 @@ a b
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2; ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery) # State after crash (before recovery)
#sqlx-nnnn_nnnn.MYD #sqlx-nnnn_nnnn.frm
#sqlx-nnnn_nnnn.MYI
db.opt
t1#P#p0.MYD
t1#P#p0.MYI
t1#P#p1.MYD
t1#P#p1.MYI
t1.frm
t1.par
t2.frm
# State after crash recovery # State after crash recovery
db.opt db.opt
t1#P#p0.MYD t1#P#p0.MYD
...@@ -652,16 +634,7 @@ a b ...@@ -652,16 +634,7 @@ a b
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2; ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery) # State after crash (before recovery)
#sqlx-nnnn_nnnn.MYD #sqlx-nnnn_nnnn.frm
#sqlx-nnnn_nnnn.MYI
db.opt
t1#P#p1.MYD
t1#P#p1.MYI
t1.frm
t1.par
t2.MYD
t2.MYI
t2.frm
# State after crash recovery # State after crash recovery
db.opt db.opt
t1#P#p0.MYD t1#P#p0.MYD
...@@ -767,16 +740,7 @@ a b ...@@ -767,16 +740,7 @@ a b
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2; ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery) # State after crash (before recovery)
#sqlx-nnnn_nnnn.MYD #sqlx-nnnn_nnnn.frm
#sqlx-nnnn_nnnn.MYI
db.opt
t1#P#p1.MYD
t1#P#p1.MYI
t1.frm
t1.par
t2.MYD
t2.MYI
t2.frm
# State after crash recovery # State after crash recovery
db.opt db.opt
t1#P#p0.MYD t1#P#p0.MYD
......
...@@ -6406,13 +6406,7 @@ a b ...@@ -6406,13 +6406,7 @@ a b
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2; ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery) # State after crash (before recovery)
#sqlx-nnnn_nnnn.ibd #sqlx-nnnn_nnnn.frm
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
t1.frm
t1.par
t2.frm
# State after crash recovery # State after crash recovery
db.opt db.opt
t1#P#p0.ibd t1#P#p0.ibd
...@@ -6514,13 +6508,7 @@ a b ...@@ -6514,13 +6508,7 @@ a b
ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2; ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery) # State after crash (before recovery)
#sqlx-nnnn_nnnn.ibd #sqlx-nnnn_nnnn.frm
db.opt
t1#P#p0.ibd
t1#P#p1.ibd
t1.frm
t1.par
t2.frm
# State after crash recovery # State after crash recovery
db.opt db.opt
t1#P#p0.ibd t1#P#p0.ibd
...@@ -6623,12 +6611,6 @@ ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2; ...@@ -6623,12 +6611,6 @@ ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery) # State after crash (before recovery)
#sqlx-nnnn_nnnn.ibd #sqlx-nnnn_nnnn.ibd
db.opt
t1#P#p1.ibd
t1.frm
t1.par
t2.frm
t2.ibd
# State after crash recovery # State after crash recovery
db.opt db.opt
t1#P#p0.ibd t1#P#p0.ibd
...@@ -6731,12 +6713,6 @@ ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2; ...@@ -6731,12 +6713,6 @@ ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
# State after crash (before recovery) # State after crash (before recovery)
#sqlx-nnnn_nnnn.ibd #sqlx-nnnn_nnnn.ibd
db.opt
t1#P#p1.ibd
t1.frm
t1.par
t2.frm
t2.ibd
# State after crash recovery # State after crash recovery
db.opt db.opt
t1#P#p0.ibd t1#P#p0.ibd
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment