summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/innodb/r/innodb-missing-file.result12
-rw-r--r--mysql-test/suite/innodb/t/innodb-missing-file.test26
-rw-r--r--mysql-test/suite/mariabackup/missing_ibd.result6
-rw-r--r--mysql-test/suite/mariabackup/missing_ibd.test26
4 files changed, 70 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-missing-file.result b/mysql-test/suite/innodb/r/innodb-missing-file.result
new file mode 100644
index 00000000000..5c10d98e541
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-missing-file.result
@@ -0,0 +1,12 @@
+call mtr.add_suppression("A link file was found named './test/t1.isl' but the linked tablespace .* could not be opened.");
+call mtr.add_suppression("InnoDB: Error: could not open single-table tablespace file ./test/t1.ibd");
+call mtr.add_suppression("InnoDB: Table test/t1 in the InnoDB data dictionary has tablespace id [0-9]+, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files\\? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary.");
+Warnings:
+Warning 1265 Data truncated for column 'pattern' at row 1
+set global innodb_file_format='Barracuda';
+CREATE TABLE t1(c1 INT) ENGINE=InnoDB DATA DIRECTORY='MYSQL_TMP_DIR';
+INSERT INTO t1 VALUES(1);
+# Kill the server
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
+drop table t1;
diff --git a/mysql-test/suite/innodb/t/innodb-missing-file.test b/mysql-test/suite/innodb/t/innodb-missing-file.test
new file mode 100644
index 00000000000..451e29796ac
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-missing-file.test
@@ -0,0 +1,26 @@
+-- source include/have_innodb.inc
+
+call mtr.add_suppression("A link file was found named './test/t1.isl' but the linked tablespace .* could not be opened.");
+call mtr.add_suppression("InnoDB: Error: could not open single-table tablespace file ./test/t1.ibd");
+call mtr.add_suppression("InnoDB: Table test/t1 in the InnoDB data dictionary has tablespace id [0-9]+, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files\\? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary.");
+
+--disable_warnings
+set global innodb_file_format='Barracuda';
+--enable_warnings
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+EVAL CREATE TABLE t1(c1 INT) ENGINE=InnoDB DATA DIRECTORY='$MYSQL_TMP_DIR';
+INSERT INTO t1 VALUES(1);
+let $MYSQLD_DATADIR = `SELECT @@datadir`;
+
+--source include/kill_mysqld.inc
+
+--copy_file $MYSQL_TMP_DIR/test/t1.ibd $MYSQL_TMP_DIR/test/t1_1.ibd
+--remove_file $MYSQL_TMP_DIR/test/t1.ibd
+
+--source include/start_mysqld.inc
+--error ER_NO_SUCH_TABLE_IN_ENGINE
+select * from t1;
+drop table t1;
+
+--remove_file $MYSQL_TMP_DIR/test/t1_1.ibd
diff --git a/mysql-test/suite/mariabackup/missing_ibd.result b/mysql-test/suite/mariabackup/missing_ibd.result
new file mode 100644
index 00000000000..53989be7c14
--- /dev/null
+++ b/mysql-test/suite/mariabackup/missing_ibd.result
@@ -0,0 +1,6 @@
+create table t1(c1 int) engine=InnoDB;
+INSERT INTO t1 VALUES(1);
+# xtrabackup backup
+select * from t1;
+ERROR 42S02: Table 'test.t1' doesn't exist in engine
+drop table t1;
diff --git a/mysql-test/suite/mariabackup/missing_ibd.test b/mysql-test/suite/mariabackup/missing_ibd.test
new file mode 100644
index 00000000000..689d237aa8f
--- /dev/null
+++ b/mysql-test/suite/mariabackup/missing_ibd.test
@@ -0,0 +1,26 @@
+--source include/have_innodb.inc
+
+create table t1(c1 int) engine=InnoDB;
+INSERT INTO t1 VALUES(1);
+let MYSQLD_DATADIR=`select @@datadir`;
+
+--source include/shutdown_mysqld.inc
+
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQL_TMP_DIR/t1.ibd
+--remove_file $MYSQLD_DATADIR/test/t1.ibd
+
+--source include/start_mysqld.inc
+
+echo # xtrabackup backup;
+let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--disable_result_log
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+--enable_result_log
+
+rmdir $targetdir;
+
+--error ER_NO_SUCH_TABLE_IN_ENGINE
+select * from t1;
+drop table t1;
+
+--remove_file $MYSQL_TMP_DIR/t1.ibd