mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
MDEV-19886 InnoDB returns misleading ER_NO_SUCH_TABLE_IN_ENGINE
A fix in MySQL 5.7.6 was not completely merged to MariaDB: Bug#19419026 WHEN A TABLESPACE IS NOT FOUND, DO NOT REPORT "TABLE NOT FOUND"
This commit is contained in:
parent
6d2b236568
commit
92feac53a6
9 changed files with 74 additions and 30 deletions
|
|
@ -8,23 +8,23 @@ CREATE TABLE `x..d` (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
|
|||
CREATE TABLE t1(a SERIAL)ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1),(2),(3);
|
||||
SELECT * FROM t;
|
||||
ERROR 42S02: Table 'test.t' doesn't exist in engine
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
ALTER TABLE t ADD INDEX (a), ALGORITHM=INPLACE;
|
||||
ERROR 42S02: Table 'test.t' doesn't exist in engine
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 1812 Tablespace is missing for table 'test/t'
|
||||
Error 1932 Table 'test.t' doesn't exist in engine
|
||||
Error 1030 Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
ALTER TABLE t ADD INDEX (a), ALGORITHM=COPY;
|
||||
ERROR 42S02: Table 'test.t' doesn't exist in engine
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 1812 Tablespace is missing for table 'test/t'
|
||||
Error 1932 Table 'test.t' doesn't exist in engine
|
||||
Error 1030 Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
ALTER TABLE t AUTO_INCREMENT=1, ALGORITHM=INPLACE;
|
||||
ERROR 42S02: Table 'test.t' doesn't exist in engine
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
ALTER TABLE t AUTO_INCREMENT=1, ALGORITHM=COPY;
|
||||
ERROR 42S02: Table 'test.t' doesn't exist in engine
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
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;
|
||||
|
|
@ -37,7 +37,7 @@ 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
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
DROP TABLE `x..d`;
|
||||
ALTER TABLE t1 DISCARD TABLESPACE;
|
||||
ALTER TABLE t1 AUTO_INCREMENT=1, ALGORITHM=INPLACE;
|
||||
|
|
|
|||
11
mysql-test/suite/innodb/r/missing_tablespaces.result
Normal file
11
mysql-test/suite/innodb/r/missing_tablespaces.result
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# Bug#19419026 WHEN A TABLESPACE IS NOT FOUND, DO NOT REPORT "TABLE NOT FOUND"
|
||||
#
|
||||
CREATE DATABASE `..................................................`;
|
||||
USE `..................................................`;
|
||||
CREATE TABLE `..................................................` (ID INT)
|
||||
ENGINE=INNODB;
|
||||
select * from `..................................................`;
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
DROP TABLE `..................................................`;
|
||||
DROP DATABASE `..................................................`;
|
||||
|
|
@ -11,7 +11,7 @@ t CREATE TABLE `t` (
|
|||
UNIQUE KEY `a` (`a`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
|
||||
SELECT * FROM t;
|
||||
ERROR 42S02: Table 'test.t' doesn't exist in engine
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
TRUNCATE TABLE t;
|
||||
ERROR 42S02: Table 'test.t' doesn't exist in engine
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
DROP TABLE t;
|
||||
|
|
|
|||
|
|
@ -34,22 +34,21 @@ INSERT INTO t1 VALUES(1),(2),(3);
|
|||
|
||||
--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
|
||||
--error ER_GET_ERRNO
|
||||
SELECT * FROM t;
|
||||
|
||||
--error ER_NO_SUCH_TABLE_IN_ENGINE
|
||||
--error ER_GET_ERRNO
|
||||
ALTER TABLE t ADD INDEX (a), ALGORITHM=INPLACE;
|
||||
SHOW WARNINGS;
|
||||
|
||||
--error ER_NO_SUCH_TABLE_IN_ENGINE
|
||||
--error ER_GET_ERRNO
|
||||
ALTER TABLE t ADD INDEX (a), ALGORITHM=COPY;
|
||||
SHOW WARNINGS;
|
||||
|
||||
--error ER_NO_SUCH_TABLE_IN_ENGINE
|
||||
--error ER_GET_ERRNO
|
||||
ALTER TABLE t AUTO_INCREMENT=1, ALGORITHM=INPLACE;
|
||||
--error ER_NO_SUCH_TABLE_IN_ENGINE
|
||||
--error ER_GET_ERRNO
|
||||
ALTER TABLE t AUTO_INCREMENT=1, ALGORITHM=COPY;
|
||||
|
||||
--error ER_PARSE_ERROR
|
||||
|
|
@ -60,7 +59,7 @@ ALTER TABLE t ALGORITHM=COPY, DISCARD TABLESPACE;
|
|||
ALTER TABLE t ALGORITHM=DEFAULT, DISCARD TABLESPACE;
|
||||
ALTER TABLE t DISCARD TABLESPACE;
|
||||
DROP TABLE t;
|
||||
--error ER_NO_SUCH_TABLE_IN_ENGINE
|
||||
--error ER_GET_ERRNO
|
||||
SELECT * FROM `x..d`;
|
||||
DROP TABLE `x..d`;
|
||||
|
||||
|
|
|
|||
36
mysql-test/suite/innodb/t/missing_tablespaces.test
Normal file
36
mysql-test/suite/innodb/t/missing_tablespaces.test
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
#Restarting not supported in embedded
|
||||
--source include/not_embedded.inc
|
||||
#Windows has trouble creating files/directories with long names
|
||||
--source include/not_windows.inc
|
||||
|
||||
--echo #
|
||||
--echo # Bug#19419026 WHEN A TABLESPACE IS NOT FOUND, DO NOT REPORT "TABLE NOT FOUND"
|
||||
--echo #
|
||||
|
||||
#Create database and tablename with all special characters
|
||||
|
||||
CREATE DATABASE `..................................................`;
|
||||
USE `..................................................`;
|
||||
CREATE TABLE `..................................................` (ID INT)
|
||||
ENGINE=INNODB;
|
||||
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
--remove_file $MYSQLTEST_VARDIR/mysqld.1/data/@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e/@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e.ibd
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number 2 in a file operation.");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified.");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot open datafile for read-only");
|
||||
call mtr.add_suppression("\\[Warning\\] InnoDB: Ignoring tablespace .* because it could not be opened");
|
||||
--enable_query_log
|
||||
|
||||
--error ER_GET_ERRNO
|
||||
select * from `..................................................`;
|
||||
DROP TABLE `..................................................`;
|
||||
DROP DATABASE `..................................................`;
|
||||
|
|
@ -15,8 +15,8 @@ let $datadir=`select @@datadir`;
|
|||
--remove_file $datadir/test/t.ibd
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
--error ER_NO_SUCH_TABLE_IN_ENGINE
|
||||
--error ER_GET_ERRNO
|
||||
SELECT * FROM t;
|
||||
--error ER_NO_SUCH_TABLE_IN_ENGINE
|
||||
--error ER_GET_ERRNO
|
||||
TRUNCATE TABLE t;
|
||||
DROP TABLE t;
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@ 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
|
||||
ERROR HY000: Got error 194 "Tablespace is missing for a table" from storage engine InnoDB
|
||||
drop table t1;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir
|
|||
|
||||
rmdir $targetdir;
|
||||
|
||||
--error ER_NO_SUCH_TABLE_IN_ENGINE
|
||||
--error ER_GET_ERRNO
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue