Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.2.9
-
None
-
CentOS 7.4
Description
When attempting to create an index on a temporary table, replication on any slaves breaks with a "table does not exist" error. This is easy to reproduce. With a master and slave set up with GTID (not sure if this matters - did not test non-GTID replication) and async replication, run the following statements:
CREATE TEMPORARY TABLE `t3` (`c1` INT, `c2` INT, PRIMARY KEY(`c1`)) ENGINE=InnoDB;
CREATE INDEX `idx1` ON `t3` (`c2`);
DROP TEMPORARY TABLE `t3`;
You will find that replication on the slave has broken with the following error:
Error 'Table 'test.t3' doesn't exist' on query. Default database: 'test'. Query: 'CREATE INDEX `idx1` ON `t3` (`c2`)'
Curiously enough, this only seems to be an issue with CREATE INDEX. This can be observed with the following statements, which do not break replication:
CREATE TEMPORARY TABLE `t3` (`c1` INT, `c2` INT, PRIMARY KEY(`c1`)) ENGINE=InnoDB;
ALTER TABLE `t3` ADD INDEX `idx1` (`c2`);
DROP TEMPORARY TABLE `t3`;
This is especially curious as the manual suggests that CREATE INDEX is merely syntactic sugar for ALTER TABLE.
Ideally, CREATE INDEX would not break replication slaves when used on temporary tables.
Attachments
Issue Links
- duplicates
-
MDEV-9266 Creating index on temporaray table breaks replication
- Closed