diff options
Diffstat (limited to 'mysql-test/suite/innodb')
17 files changed, 382 insertions, 21 deletions
diff --git a/mysql-test/suite/innodb/r/deadlock_in_subqueries_join.result b/mysql-test/suite/innodb/r/deadlock_in_subqueries_join.result new file mode 100644 index 00000000000..2e82b0662f8 --- /dev/null +++ b/mysql-test/suite/innodb/r/deadlock_in_subqueries_join.result @@ -0,0 +1,50 @@ +CREATE TABLE t1 ( +pkey int NOT NULL PRIMARY KEY, +c int +) ENGINE=InnoDB; +INSERT INTO t1 VALUES(1,1); +CREATE TABLE t2 ( +pkey int NOT NULL PRIMARY KEY, +c int +) ENGINE=InnoDB DEFAULT CHARSET=latin1; +INSERT INTO t2 VALUES (2, NULL); +CREATE TABLE t3 (c int) engine = InnoDB; +INSERT INTO t3 VALUES (10), (20), (30), (40), (50); +connect con1, localhost,root,,; +connection default; +START TRANSACTION; +UPDATE t3 SET c=c+1000; +SELECT * FROM t1 FOR UPDATE; +pkey c +1 1 +connection con1; +START TRANSACTION; +DELETE FROM t2 WHERE c NOT IN (SELECT ref_0.pkey FROM t1 AS ref_0 INNER JOIN t1 AS ref_1 ON ref_0.c = ref_0.pkey); +connection default; +SELECT * FROM t2 FOR UPDATE; +pkey c +2 NULL +COMMIT; +connection con1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +connection default; +START TRANSACTION; +UPDATE t3 SET c=c+1000; +SELECT * FROM t1 FOR UPDATE; +pkey c +1 1 +connection con1; +START TRANSACTION; +UPDATE t2 SET pkey=pkey+10 WHERE c NOT IN (SELECT ref_0.pkey FROM t1 AS ref_0 INNER JOIN t1 AS ref_1 ON ref_0.c = ref_0.pkey); +connection default; +SELECT * FROM t2 FOR UPDATE; +pkey c +2 NULL +COMMIT; +connection con1; +ERROR 40001: Deadlock found when trying to get lock; try restarting transaction +COMMIT; +disconnect con1; +connection default; +DROP TABLE t1,t2,t3; diff --git a/mysql-test/suite/innodb/r/full_crc32_import.result b/mysql-test/suite/innodb/r/full_crc32_import.result index f08cc9a5e53..99f11548420 100644 --- a/mysql-test/suite/innodb/r/full_crc32_import.result +++ b/mysql-test/suite/innodb/r/full_crc32_import.result @@ -38,6 +38,8 @@ restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Internal error: Drop all secondary indexes before importing table test/t1 when .cfg file is missing. ALTER TABLE t1 DROP INDEX b; +Warnings: +Warning 1814 Tablespace has been discarded for table `t1` ALTER TABLE t1 IMPORT TABLESPACE; SHOW CREATE TABLE t1; Table Create Table @@ -116,9 +118,10 @@ restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Internal error: Drop all secondary indexes before importing table test/t1 when .cfg file is missing. ALTER TABLE t1 DROP INDEX idx1; -ALTER TABLE t1 IMPORT TABLESPACE; Warnings: Warning 1814 Tablespace has been discarded for table `t1` +ALTER TABLE t1 IMPORT TABLESPACE; +Warnings: Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t1.cfg', will attempt to import without schema verification SHOW CREATE TABLE t1; Table Create Table diff --git a/mysql-test/suite/innodb/r/import_tablespace_race.result b/mysql-test/suite/innodb/r/import_tablespace_race.result new file mode 100644 index 00000000000..6c8b2e3a26e --- /dev/null +++ b/mysql-test/suite/innodb/r/import_tablespace_race.result @@ -0,0 +1,27 @@ +# +# MDEV-29144 ER_TABLE_SCHEMA_MISMATCH or crash on DISCARD/IMPORT +# +call mtr.add_suppression("InnoDB: Unknown index id"); +CREATE TABLE t (pk int PRIMARY KEY, c varchar(1024)) +ENGINE=InnoDB CHARSET latin1; +INSERT INTO t SELECT seq, 'x' FROM seq_1_to_100; +connect con1,localhost,root,,test; +BEGIN NOT ATOMIC +DECLARE a INT DEFAULT 0; +REPEAT +SET a= a+1; +UPDATE t SET c = 'xx' WHERE pk = a; +UNTIL a = 100 +END REPEAT; +END +$ +connection default; +ALTER TABLE t NOWAIT ADD INDEX (c); +connection con1; +connection default; +FLUSH TABLE t FOR EXPORT; +UNLOCK TABLES; +DROP TABLE t; +ALTER TABLE t DISCARD TABLESPACE; +ALTER TABLE t IMPORT TABLESPACE; +DROP TABLE t; diff --git a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result index 3e977cdde2f..1609812ed30 100644 --- a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result +++ b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result @@ -146,6 +146,8 @@ CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB; ALTER TABLE t DISCARD TABLESPACE; SET sql_mode='NO_ZERO_DATE'; ALTER TABLE t ADD c DATE NOT NULL; +Warnings: +Warning 1814 Tablespace has been discarded for table `t` SET sql_mode=DEFAULT; DROP TABLE t; # End of 10.3 tests diff --git a/mysql-test/suite/innodb/r/innodb-table-online.result b/mysql-test/suite/innodb/r/innodb-table-online.result index b4e347b2600..5a8b3d24d75 100644 --- a/mysql-test/suite/innodb/r/innodb-table-online.result +++ b/mysql-test/suite/innodb/r/innodb-table-online.result @@ -452,10 +452,26 @@ SET DEBUG_SYNC = 'now WAIT_FOR created'; UPDATE t1 SET f = REPEAT('a', 20000); SET DEBUG_SYNC = 'now SIGNAL updated'; connection con1; -disconnect con1; connection default; DROP TABLE t1; -SET DEBUG_SYNC = 'RESET'; +# +# MDEV-29977 Memory leak in row_log_table_apply_update +# +CREATE TABLE t1(f1 longtext, f2 int, KEY(f1(1024)), KEY(f2, f1(20))) ENGINE=InnoDB; +INSERT INTO t1 VALUES('a', 1); +connection con1; +set DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con_default WAIT_FOR con1_signal"; +ALTER TABLE t1 FORCE; +connection default; +SET DEBUG_SYNC="now WAIT_FOR con_default"; +UPDATE t1 SET f1 = NULL; +UPDATE t1 SET f1 = REPEAT('b', 9000); +SET DEBUG_SYNC="now SIGNAL con1_signal"; +connection con1; +DROP TABLE t1; +connection default; +SET DEBUG_SYNC=RESET; +disconnect con1; SET GLOBAL innodb_file_per_table = @global_innodb_file_per_table_orig; SET GLOBAL innodb_monitor_enable = default; SET GLOBAL innodb_monitor_disable = default; diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-1.result b/mysql-test/suite/innodb/r/innodb-wl5522-1.result index 55557a8fb99..204d6bc8b78 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522-1.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522-1.result @@ -795,3 +795,19 @@ DROP DATABASE testdb_wl5522; call mtr.add_suppression("Got error -1 when reading table '.*'"); call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*"); call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded"); +# +# MDEV-27882 Innodb - recognise MySQL-8.0 innodb flags and give a specific error message +# +# +CREATE TABLE `t1` (`i` int(11) NOT NULL, PRIMARY KEY (`i`) ) ENGINE=InnoDB; +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +UNLOCK TABLES; +ALTER TABLE t1 DISCARD TABLESPACE; +call mtr.add_suppression("InnoDB: unsupported MySQL tablespace"); +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR 42000: Table 't1' uses an extension that doesn't exist in this MariaDB version +DROP TABLE t1; +# +# End of 10.3 tests +# diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result index 848079d27b4..5770ebb27db 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result @@ -451,7 +451,7 @@ ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure"; ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Too many concurrent transactions +ERROR HY000: Internal error: Error importing tablespace for table `test`.`t1` : Too many concurrent transactions restore: t1 .ibd and .cfg files SET SESSION debug_dbug=@saved_debug_dbug; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; @@ -854,7 +854,7 @@ ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; ALTER TABLE t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Data structure corruption +ERROR HY000: Internal error: Error importing tablespace for table `test`.`t1` : Data structure corruption SET SESSION debug_dbug=@saved_debug_dbug; DROP TABLE t1; unlink: t1.ibd @@ -902,6 +902,8 @@ ALTER TABLE t1 DISCARD TABLESPACE; SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` ALTER TABLE t1 ADD INDEX idx(c1); +Warnings: +Warning 1814 Tablespace has been discarded for table `t1` DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result index 485378988df..7bcc57c5bd5 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522.result @@ -252,13 +252,15 @@ ERROR HY000: Schema mismatch (Index x not found in tablespace meta-data file.) select count(*) from t1; ERROR HY000: Tablespace has been discarded for table `t1` ALTER TABLE t1 DROP INDEX x; +Warnings: +Warning 1814 Tablespace has been discarded for table `t1` ALTER TABLE t1 DROP INDEX x, ALGORITHM=copy; ERROR 42000: Can't DROP INDEX `x`; check that it exists ALTER TABLE t1 ADD INDEX idx(c2); -restore: t1 .ibd and .cfg files -ALTER TABLE t1 IMPORT TABLESPACE; Warnings: Warning 1814 Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK diff --git a/mysql-test/suite/innodb/r/instant_alter_bugs.result b/mysql-test/suite/innodb/r/instant_alter_bugs.result index db98a6a5fcf..f56938550ac 100644 --- a/mysql-test/suite/innodb/r/instant_alter_bugs.result +++ b/mysql-test/suite/innodb/r/instant_alter_bugs.result @@ -193,8 +193,6 @@ Warnings: Warning 1814 Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files ALTER TABLE t1 IMPORT TABLESPACE; -Warnings: -Warning 1814 Tablespace has been discarded for table `t1` SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/suite/innodb/r/instant_alter_import.result b/mysql-test/suite/innodb/r/instant_alter_import.result index 2b2cd8bf796..e1ef373af06 100644 --- a/mysql-test/suite/innodb/r/instant_alter_import.result +++ b/mysql-test/suite/innodb/r/instant_alter_import.result @@ -150,8 +150,6 @@ INSERT INTO t1 VALUES(1); FLUSH TABLE t1 FOR EXPORT; unlock tables; ALTER TABLE t IMPORT tablespace; -Warnings: -Warning 1814 Tablespace has been discarded for table `t` check table t; Table Op Msg_type Msg_text test.t check status OK diff --git a/mysql-test/suite/innodb/r/restart.result b/mysql-test/suite/innodb/r/restart.result index aba08a9ae99..95d79a0ab14 100644 --- a/mysql-test/suite/innodb/r/restart.result +++ b/mysql-test/suite/innodb/r/restart.result @@ -3,6 +3,8 @@ # # FIXME: Unlike MySQL, maybe MariaDB should not read the .ibd files # of tables with .isl file or DATA DIRECTORY attribute. +call mtr.add_suppression("\\[ERROR\\] InnoDB: MySQL-8\\.0 tablespace in "); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Restart in MySQL for migration/recovery\\."); # FIXME: This is much more noisy than MariaDB 10.1! call mtr.add_suppression("\\[ERROR\\] InnoDB: Tablespace flags are invalid in datafile: .*test.t[rcd]\\.ibd"); call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number .* in a file operation\\."); @@ -40,3 +42,11 @@ Warning 1210 innodb_buffer_pool_size must be at least MIN_VAL for innodb_page_si Error 1231 Variable 'innodb_buffer_pool_size' can't be set to the value of 'WRONG_VALUE' EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size); SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; +# +# MDEV-27882 Innodb - recognise MySQL-8.0 innodb flags and give a specific error message +# +FOUND 1 /InnoDB: MySQL-8\.0 tablespace in \./ibdata1/ in attempted_start.err +# restart +# +# End of 10.3 tests +# diff --git a/mysql-test/suite/innodb/t/create_isl_with_direct.test b/mysql-test/suite/innodb/t/create_isl_with_direct.test index 2092d03b72f..45d7fbf4ea5 100644 --- a/mysql-test/suite/innodb/t/create_isl_with_direct.test +++ b/mysql-test/suite/innodb/t/create_isl_with_direct.test @@ -2,13 +2,6 @@ --source include/have_innodb.inc --source include/have_symlink.inc ---disable_query_log -CALL mtr.add_suppression(".*Failed to set O_DIRECT on file.*"); - -# The below mtr suppression to avoid failure in solaris platform. -CALL mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to set DIRECTIO_ON on file.*"); ---enable_query_log - SHOW VARIABLES LIKE 'innodb_flush_method'; let MYSQLD_DATADIR=`SELECT @@datadir`; diff --git a/mysql-test/suite/innodb/t/deadlock_in_subqueries_join.test b/mysql-test/suite/innodb/t/deadlock_in_subqueries_join.test new file mode 100644 index 00000000000..b3adfb3b02d --- /dev/null +++ b/mysql-test/suite/innodb/t/deadlock_in_subqueries_join.test @@ -0,0 +1,81 @@ +--source include/have_innodb.inc +--source include/count_sessions.inc + +CREATE TABLE t1 ( + pkey int NOT NULL PRIMARY KEY, + c int +) ENGINE=InnoDB; + +INSERT INTO t1 VALUES(1,1); + +CREATE TABLE t2 ( + pkey int NOT NULL PRIMARY KEY, + c int +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +INSERT INTO t2 VALUES (2, NULL); + +# The following table is to increase tansaction weight on deadlock resolution +CREATE TABLE t3 (c int) engine = InnoDB; +INSERT INTO t3 VALUES (10), (20), (30), (40), (50); + +--let $i= 2 +--let $delete= 2 +--let $update= 1 +--connect(con1, localhost,root,,) + +while($i) { +--connection default +START TRANSACTION; # trx 1 +# The following update is necessary to increase the transaction weight, which is +# calculated as the number of locks + the number of undo records during deadlock +# report. Victim's transaction should have minimum weight. We need trx 2 to be +# choosen as victim, that's why we need to increase the current transaction +# weight. +UPDATE t3 SET c=c+1000; +SELECT * FROM t1 FOR UPDATE; + +--connection con1 +START TRANSACTION; # trx 2 +# 1) read record from t2, lock it +# 2) check if the read record should be deleted, i.e. read record from t1, +# as the record from t1 is locked by trx 1, the subselect will be suspended. +# see 'while' loop in mysql_delete() or mysql_update() and +# select->skip_record(thd) call for details. +if ($i == $delete) { +--send DELETE FROM t2 WHERE c NOT IN (SELECT ref_0.pkey FROM t1 AS ref_0 INNER JOIN t1 AS ref_1 ON ref_0.c = ref_0.pkey) +} +if ($i == $update) { +--send UPDATE t2 SET pkey=pkey+10 WHERE c NOT IN (SELECT ref_0.pkey FROM t1 AS ref_0 INNER JOIN t1 AS ref_1 ON ref_0.c = ref_0.pkey) +} + +--connection default +let $wait_condition= + SELECT count(*) = 1 FROM information_schema.processlist + WHERE (state = 'Sending data' OR state = "Updating") + AND (info LIKE 'delete from t2 where%' OR + info LIKE 'UPDATE t2 SET pkey=pkey+10 WHERE%'); +--source include/wait_condition.inc + +# The record from t2 is locked by the previous delete, so trx 2 is waiting for +# trx 1, and trx 1 will be blocked by trx 2 with the following SELECT. So we +# have deadlock here. And trx 2 is chosen as deadlock victim as trx 1 has +# greater weight. +SELECT * FROM t2 FOR UPDATE; +COMMIT; + +--connection con1 +# If the bug is not fixed, there will be assertion failure as +# mysql_delete()/mysql_update() will continue execution despite its subselect +# got deadlock error +--error ER_LOCK_DEADLOCK +--reap +COMMIT; +--dec $i +} + +--disconnect con1 + +--connection default +DROP TABLE t1,t2,t3; +--source include/wait_until_count_sessions.inc diff --git a/mysql-test/suite/innodb/t/import_tablespace_race.test b/mysql-test/suite/innodb/t/import_tablespace_race.test new file mode 100644 index 00000000000..10ffe061ed1 --- /dev/null +++ b/mysql-test/suite/innodb/t/import_tablespace_race.test @@ -0,0 +1,55 @@ +--source include/have_innodb.inc +--source include/have_sequence.inc + +--echo # +--echo # MDEV-29144 ER_TABLE_SCHEMA_MISMATCH or crash on DISCARD/IMPORT +--echo # + +call mtr.add_suppression("InnoDB: Unknown index id"); +CREATE TABLE t (pk int PRIMARY KEY, c varchar(1024)) +ENGINE=InnoDB CHARSET latin1; +INSERT INTO t SELECT seq, 'x' FROM seq_1_to_100; + +--connect (con1,localhost,root,,test) +--delimiter $ +--send + BEGIN NOT ATOMIC + DECLARE a INT DEFAULT 0; + REPEAT + SET a= a+1; + UPDATE t SET c = 'xx' WHERE pk = a; + UNTIL a = 100 + END REPEAT; + END +$ +--delimiter ; + +--connection default +--error 0,ER_LOCK_WAIT_TIMEOUT +ALTER TABLE t NOWAIT ADD INDEX (c); + +--connection con1 +--reap + +--connection default + +--let $datadir= `select @@datadir` + +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 +UNLOCK TABLES; + +DROP TABLE t; +--disable_query_log +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 +ALTER TABLE t IMPORT TABLESPACE; + +# Cleanup +DROP TABLE t; diff --git a/mysql-test/suite/innodb/t/innodb-table-online.test b/mysql-test/suite/innodb/t/innodb-table-online.test index 77b84fe79db..bfaabf24bd2 100644 --- a/mysql-test/suite/innodb/t/innodb-table-online.test +++ b/mysql-test/suite/innodb/t/innodb-table-online.test @@ -420,11 +420,28 @@ SET DEBUG_SYNC = 'now SIGNAL updated'; connection con1; reap; -disconnect con1; connection default; DROP TABLE t1; -SET DEBUG_SYNC = 'RESET'; +--echo # +--echo # MDEV-29977 Memory leak in row_log_table_apply_update +--echo # +CREATE TABLE t1(f1 longtext, f2 int, KEY(f1(1024)), KEY(f2, f1(20))) ENGINE=InnoDB; +INSERT INTO t1 VALUES('a', 1); +connection con1; +set DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL con_default WAIT_FOR con1_signal"; +send ALTER TABLE t1 FORCE; +connection default; +SET DEBUG_SYNC="now WAIT_FOR con_default"; +UPDATE t1 SET f1 = NULL; +UPDATE t1 SET f1 = REPEAT('b', 9000); +SET DEBUG_SYNC="now SIGNAL con1_signal"; +connection con1; +reap; +DROP TABLE t1; +connection default; +SET DEBUG_SYNC=RESET; +disconnect con1; # Check that all connections opened by test cases in this file are really # gone so execution of other tests won't be affected by their presence. diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-1.test b/mysql-test/suite/innodb/t/innodb-wl5522-1.test index 0d59df11c44..dbd58835ec6 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522-1.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522-1.test @@ -932,3 +932,34 @@ call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tabl --remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd --remove_file $MYSQLTEST_VARDIR/tmp/t1_fk.cfg --remove_file $MYSQLTEST_VARDIR/tmp/t1_fk.ibd + +--echo # +--echo # MDEV-27882 Innodb - recognise MySQL-8.0 innodb flags and give a specific error message +--echo # +--echo # + +CREATE TABLE `t1` (`i` int(11) NOT NULL, PRIMARY KEY (`i`) ) ENGINE=InnoDB; +FLUSH TABLES t1 FOR EXPORT; + +# We use the cfg file of ours. +perl; +do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; +ib_backup_tablespaces("test", "t1"); +EOF + +UNLOCK TABLES; +ALTER TABLE t1 DISCARD TABLESPACE; + +--move_file $MYSQLTEST_VARDIR/tmp/t1.cfg $MYSQLD_DATADIR/test/t1.cfg +--copy_file std_data/mysql80/t1.ibd $MYSQLD_DATADIR/test/t1.ibd + +call mtr.add_suppression("InnoDB: unsupported MySQL tablespace"); +--error ER_UNSUPPORTED_EXTENSION +ALTER TABLE t1 IMPORT TABLESPACE; + +DROP TABLE t1; +--remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd + +--echo # +--echo # End of 10.3 tests +--echo # diff --git a/mysql-test/suite/innodb/t/restart.test b/mysql-test/suite/innodb/t/restart.test index 1ca4f51c747..4835cc997a8 100644 --- a/mysql-test/suite/innodb/t/restart.test +++ b/mysql-test/suite/innodb/t/restart.test @@ -15,6 +15,9 @@ let page_size= `select @@innodb_page_size`; --echo # FIXME: Unlike MySQL, maybe MariaDB should not read the .ibd files --echo # of tables with .isl file or DATA DIRECTORY attribute. +call mtr.add_suppression("\\[ERROR\\] InnoDB: MySQL-8\\.0 tablespace in "); +call mtr.add_suppression("\\[ERROR\\] InnoDB: Restart in MySQL for migration/recovery\\."); + --echo # FIXME: This is much more noisy than MariaDB 10.1! call mtr.add_suppression("\\[ERROR\\] InnoDB: Tablespace flags are invalid in datafile: .*test.t[rcd]\\.ibd"); call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number .* in a file operation\\."); @@ -46,7 +49,7 @@ die unless open OUT, ">", "$ENV{datadir}/test/tc.ibd"; print OUT "bar " x $ENV{page_size}; close OUT or die; die unless open OUT, ">", "$ENV{MYSQL_TMP_DIR}/test/td.ibd"; -print OUT "xyz " x $ENV{page_size}; +print OUT "Xyz " x $ENV{page_size}; close OUT or die; die unless open ISL, "+<", "$ENV{datadir}/test/td.isl"; $_=<ISL>; @@ -109,3 +112,60 @@ EXECUTE IMMEDIATE 'SET GLOBAL innodb_buffer_pool_size = ?' USING (@min_pool_size --source include/wait_condition.inc SET GLOBAL innodb_buffer_pool_size = @innodb_buffer_pool_size_orig; + +--echo # +--echo # MDEV-27882 Innodb - recognise MySQL-8.0 innodb flags and give a specific error message +--echo # + +--let MYSQLD_DATADIR= `SELECT @@datadir` +--let SERVER_ID= `SELECT @@server_id` +--let EXPECT_FILE_NAME= $MYSQLTEST_VARDIR/tmp/mysqld.$SERVER_ID.expect + +--source include/shutdown_mysqld.inc + +--move_file $MYSQLD_DATADIR/ibdata1 $MYSQLD_DATADIR/ibdata1.bak +--copy_file std_data/mysql80/ibdata1_$page_size $MYSQLD_DATADIR/ibdata1 + +perl; +use IO::Handle; +my $size = 9 * 1048576; +if ($ENV{MTR_COMBINATION_32K}) { + $size *= 2; +} +if ($ENV{MTR_COMBINATION_64K}) { + $size *= 4; +} +$size -= $ENV{page_size}; +die unless open(FILE, ">>", "$ENV{MYSQLD_DATADIR}/ibdata1"); +binmode FILE; + +print FILE chr(0) x $size; +close(FILE); +EOF + +--let ibdata_size='9M' +if ($MTR_COMBINATION_32K) +{ +--let ibdata_size='18M' +} +if ($MTR_COMBINATION_64K) +{ +--let ibdata_size='36M' +} + +--error 1 +exec $MYSQLD --no-defaults --skip-networking --innodb_data_file_path=ibdata1:$ibdata_size --innodb-page-size=$page_size --datadir=$MYSQLD_DATADIR --log-error=$MYSQL_TMP_DIR/attempted_start.err; + +let SEARCH_FILE= $MYSQL_TMP_DIR/attempted_start.err; +let SEARCH_PATTERN= InnoDB: MySQL-8\.0 tablespace in \./ibdata1; +source include/search_pattern_in_file.inc; + +--remove_file $MYSQL_TMP_DIR/attempted_start.err +--remove_file $MYSQLD_DATADIR/ibdata1 +--move_file $MYSQLD_DATADIR/ibdata1.bak $MYSQLD_DATADIR/ibdata1 + +--source include/start_mysqld.inc + +--echo # +--echo # End of 10.3 tests +--echo # |