mariadb/mysql-test/suite/innodb/t/alter_missing_tablespace.test
Marko Mäkelä 2d8fdfbde5 Merge 10.1 into 10.2
Replace have_innodb_zip.inc with innodb_page_size_small.inc.
2017-06-08 12:45:08 +03:00

58 lines
2.3 KiB
Text

--source include/not_embedded.inc
--source include/innodb_page_size.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`;