diff options
4 files changed, 92 insertions, 82 deletions
diff --git a/mysql-test/suite/innodb/r/alter_missing_tablespace.result b/mysql-test/suite/innodb/r/alter_missing_tablespace.result new file mode 100644 index 00000000000..1517afd1a39 --- /dev/null +++ b/mysql-test/suite/innodb/r/alter_missing_tablespace.result @@ -0,0 +1,34 @@ +# +# Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING +# OR DISCARDED TABLESPACES +# +SET GLOBAL innodb_file_per_table=1; +CREATE TABLE t(a INT)ENGINE=InnoDB; +CREATE TABLE `x..d` (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; +SELECT * FROM t; +ERROR 42S02: Table 'test.t' doesn't exist in engine +ALTER TABLE t ADD INDEX (a), ALGORITHM=INPLACE; +ERROR 42S02: Table 'test.t' doesn't exist in engine +SHOW WARNINGS; +Level Code Message +Warning 1812 Tablespace is missing for table 'test/t' +Error 1932 Table 'test.t' doesn't exist in engine +ALTER TABLE t1 ADD INDEX (a), ALGORITHM=COPY; +ERROR 42S02: Table 'test.t1' doesn't exist +SHOW WARNINGS; +Level Code Message +Error 1146 Table 'test.t1' doesn't exist +ALTER TABLE t ALGORITHM=INPLACE, DISCARD TABLESPACE; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DISCARD TABLESPACE' at line 1 +ALTER TABLE t ALGORITHM=COPY, DISCARD TABLESPACE; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DISCARD TABLESPACE' at line 1 +ALTER TABLE t ALGORITHM=DEFAULT, DISCARD TABLESPACE; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'DISCARD TABLESPACE' at line 1 +ALTER TABLE t DISCARD TABLESPACE; +Warnings: +Warning 1812 Tablespace is missing for table 'test/t' +Warning 1812 Tablespace is missing for table 'test/t' +DROP TABLE t; +SELECT * FROM `x..d`; +ERROR 42S02: Table 'test.x..d' doesn't exist in engine +DROP TABLE `x..d`; diff --git a/mysql-test/suite/innodb/r/innodb-alter-discard.result b/mysql-test/suite/innodb/r/innodb-alter-discard.result deleted file mode 100644 index 4f773185f3e..00000000000 --- a/mysql-test/suite/innodb/r/innodb-alter-discard.result +++ /dev/null @@ -1,28 +0,0 @@ -call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: .*"); -SET GLOBAL innodb_file_per_table=1; -CREATE TABLE t(a INT)ENGINE=InnoDB; -call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation."); -call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified."); -call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them."); -call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: './test/t.ibd' OS error: .*"); -call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`.`t` because it could not be opened."); -call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .*"); -call mtr.add_suppression("InnoDB: Error: trying to open a table, but could not$"); -call mtr.add_suppression("MySQL is trying to open a table handle but the \.ibd file for$"); -call mtr.add_suppression("InnoDB: Table 'test/t'$"); -call mtr.add_suppression("Could not find a valid tablespace file for"); -call mtr.add_suppression("InnoDB: Tablespace open failed for '\"test\"\.\"t\"', ignored"); -call mtr.add_suppression("InnoDB: Failed to find tablespace for table '\"test\"\.\"t\"' in the cache"); -call mtr.add_suppression("InnoDB: Cannot delete tablespace [0-9]+.*not found"); -call mtr.add_suppression("Table .*t in the InnoDB data dictionary has tablespace id .*, but tablespace with that id or name does not exist"); -SELECT * FROM t; -ERROR 42S02: Table 'test.t' doesn't exist in engine -ALTER TABLE t ADD INDEX (a), ALGORITHM=INPLACE; -ERROR 42S02: Table 'test.t' doesn't exist in engine -ALTER TABLE t1 ADD INDEX (a), ALGORITHM=COPY; -ERROR 42S02: Table 'test.t1' doesn't exist -ALTER TABLE t DISCARD TABLESPACE; -Warnings: -Warning 1812 Tablespace is missing for table 'test/t' -Warning 1812 Tablespace is missing for table 'test/t' -DROP TABLE t; diff --git a/mysql-test/suite/innodb/t/alter_missing_tablespace.test b/mysql-test/suite/innodb/t/alter_missing_tablespace.test new file mode 100644 index 00000000000..643b7a4833d --- /dev/null +++ b/mysql-test/suite/innodb/t/alter_missing_tablespace.test @@ -0,0 +1,58 @@ +--source include/not_embedded.inc +--source include/have_innodb.inc + +--echo # +--echo # Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING +--echo # OR DISCARDED TABLESPACES +--echo # + +--disable_query_log +call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: "); +call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation"); +call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified"); +call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them"); +call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`.`\(t\|x\.\.d\)` because it could not be opened"); +call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing"); +call mtr.add_suppression("Could not find a valid tablespace file for"); +call mtr.add_suppression("InnoDB: Failed to find tablespace for table `test`\.`\(t\|x\.\.d\)` in the cache"); +call mtr.add_suppression("InnoDB: Cannot delete tablespace [0-9]+.*not found"); +call mtr.add_suppression("Table .* in the InnoDB data dictionary has tablespace id .*, but tablespace with that id or name does not exist"); +--enable_query_log + +let $MYSQLD_DATADIR=`select @@datadir`; +SET GLOBAL innodb_file_per_table=1; +CREATE TABLE t(a INT)ENGINE=InnoDB; +CREATE TABLE `x..d` (a INT PRIMARY KEY, b INT) ENGINE=InnoDB; + +--source include/shutdown_mysqld.inc + +# Remove the tablespace files. +--remove_file $MYSQLD_DATADIR/test/t.ibd +--remove_file $MYSQLD_DATADIR/test/x@002e@002ed.ibd + +--source include/start_mysqld.inc + +# The ER_NO_SUCH_TABLE is being thrown by ha_innobase::open(). +# The table does exist, only the tablespace does not exist. +--error ER_NO_SUCH_TABLE_IN_ENGINE +SELECT * FROM t; + +--error ER_NO_SUCH_TABLE_IN_ENGINE +ALTER TABLE t ADD INDEX (a), ALGORITHM=INPLACE; +SHOW WARNINGS; + +--error ER_NO_SUCH_TABLE +ALTER TABLE t1 ADD INDEX (a), ALGORITHM=COPY; +SHOW WARNINGS; + +--error ER_PARSE_ERROR +ALTER TABLE t ALGORITHM=INPLACE, DISCARD TABLESPACE; +--error ER_PARSE_ERROR +ALTER TABLE t ALGORITHM=COPY, DISCARD TABLESPACE; +--error ER_PARSE_ERROR +ALTER TABLE t ALGORITHM=DEFAULT, DISCARD TABLESPACE; +ALTER TABLE t DISCARD TABLESPACE; +DROP TABLE t; +--error ER_NO_SUCH_TABLE_IN_ENGINE +SELECT * FROM `x..d`; +DROP TABLE `x..d`; diff --git a/mysql-test/suite/innodb/t/innodb-alter-discard.test b/mysql-test/suite/innodb/t/innodb-alter-discard.test deleted file mode 100644 index 51faf0d9068..00000000000 --- a/mysql-test/suite/innodb/t/innodb-alter-discard.test +++ /dev/null @@ -1,54 +0,0 @@ -#Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING OR DISCARDED TABLESPACES - ---source include/not_embedded.inc ---source include/have_innodb.inc - -call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: .*"); - -let $MYSQLD_DATADIR=`select @@datadir`; -SET GLOBAL innodb_file_per_table=1; -CREATE TABLE t(a INT)ENGINE=InnoDB; - -# Shut down the server --- exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --- shutdown_server --- source include/wait_until_disconnected.inc - -# Remove the tablespace file. -let IBD=$MYSQLD_DATADIR/test/t.ibd; -perl; -unlink "$ENV{IBD}" || die "Unable to unlink $ENV{IBD}\n"; -EOF - -# Restart the server. --- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --- enable_reconnect --- source include/wait_until_connected_again.inc - -call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation."); -call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified."); -call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them."); -call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: './test/t.ibd' OS error: .*"); -call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`.`t` because it could not be opened."); -call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .*"); -call mtr.add_suppression("InnoDB: Error: trying to open a table, but could not$"); -call mtr.add_suppression("MySQL is trying to open a table handle but the \.ibd file for$"); -call mtr.add_suppression("InnoDB: Table 'test/t'$"); -call mtr.add_suppression("Could not find a valid tablespace file for"); -call mtr.add_suppression("InnoDB: Tablespace open failed for '\"test\"\.\"t\"', ignored"); -call mtr.add_suppression("InnoDB: Failed to find tablespace for table '\"test\"\.\"t\"' in the cache"); -call mtr.add_suppression("InnoDB: Cannot delete tablespace [0-9]+.*not found"); -call mtr.add_suppression("Table .*t in the InnoDB data dictionary has tablespace id .*, but tablespace with that id or name does not exist"); - -# The ER_NO_SUCH_TABLE is being thrown by ha_innobase::open(). -# The table does exist, only the tablespace does not exist. ---error ER_NO_SUCH_TABLE_IN_ENGINE -SELECT * FROM t; - ---error ER_NO_SUCH_TABLE_IN_ENGINE -ALTER TABLE t ADD INDEX (a), ALGORITHM=INPLACE; ---error ER_NO_SUCH_TABLE -ALTER TABLE t1 ADD INDEX (a), ALGORITHM=COPY; - -ALTER TABLE t DISCARD TABLESPACE; -DROP TABLE t; |