Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
-
None
Description
mysqldump may write CREATE statements related to a MERGE table before underlying tables which it unions. The merge table remains invalid until the underlying tables are created, so the dump can become unloadable.
create table t (a int) engine=MyISAM; |
create table mt (a int) engine=MERGE union (t); |
create trigger tr after insert on mt for each row set @a= 1; |
|
--exec $MYSQL_DUMP test > $MYSQL_TMP_DIR/test.dump
|
drop table mt, t; |
--exec $MYSQL test < $MYSQL_TMP_DIR/test.dump
|
|
# Cleanup
|
drop table mt; |
drop table t; |
10.3 0ca3aaa7 |
ERROR 1168 (HY000) at line 38: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
|
mysqltest: At line 7: exec of '/mnt8t/bld/10.3-nightly/bin/mysql --defaults-file=/mnt8t/bld/10.3-nightly/mysql-test/var/my.cnf test < /mnt8t/bld/10.3-nightly/mysql-test/var/tmp/test.dump' failed, error: 256, status: 1, errno: 11
|
The line 38 in the dump is
/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 trigger tr after insert on mt for each row set @a= 1 */;; |
By this time, the MERGE table mt has already been created, but the underlying table t hasn't.