Bug #77417 | Applying create temporary table SQL on a slave with replicate-rewrite-db fails | ||
---|---|---|---|
Submitted: | 19 Jun 2015 15:16 | Modified: | 4 Dec 2015 17:26 |
Reporter: | JAMES HETHERINGTON | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.6.19, 5.6.25, 5.7.8 | OS: | Linux (ubuntu 14.04.2) |
Assigned to: | CPU Architecture: | Any |
[19 Jun 2015 15:16]
JAMES HETHERINGTON
[22 Jun 2015 10:05]
JAMES HETHERINGTON
To try and replicate, I created a temporary table and dropped it with specifying the schema name on the command line, and in the binary logs the schema name was not there. I then created a temporary table and dropped it without specifying the schema name on the command line, and in the binary logs the schema name was not there. So this looks correct, but does not match my experience with the replicating of the production database with replicate_rewrite_db.
[25 Jun 2015 7:50]
MySQL Verification Team
Hello James, Thank you for the report. Thanks, Umesh
[25 Jun 2015 7:54]
JAMES HETHERINGTON
I have an SR open about this - 3-10954054701 : Replication with replicate-rewrite-db fails with temporary table already exists errors I'm not sure if it is a bug or not. The latest comment from Oracle says 'the rewrite stops working on the slave when the IF NOT EXISTS option is explicitly used by the application/client'.
[25 Jun 2015 7:59]
MySQL Verification Team
test results
Attachment: 77417_mtr.txt (text/plain), 17.88 KiB.
[25 Jun 2015 8:16]
Sven Sandberg
Posted by developer: Same reason as BUG#19942146, different symptom.
[25 Jun 2015 9:36]
MySQL Verification Team
// 5.7.8 behaves same way
[4 Dec 2015 17:26]
David Moss
Thanks for your feedback. This has been fixed in upcoming versions and the following was noted in the 5.6.29 and 5.7.11 change logs: As part of the fix for Bug #16290902, when writing a DROP TEMPORARY TABLE IF EXISTS query into the binary log, the query is no longer preceded by a USE `db` statement. Instead the query uses a fully qualified table name, for example DROP TEMPORARY TABLE IF EXISTS `db`.`t1`;. This changed the application of replicate-rewrite-db filter rules, as they work only on the default database specified in a USE statement. This caused slaves to fail when the resulting CREATE TEMPORARY TABLE was applied. The fix ensures that at the time of writing a DROP TEMPORARY TABLE IF EXISTS query into the binary log, a check is made for the default database. If it exists then the query is written as USE default_db in the binary log. If a default database is not present then the query is logged with the qualified table name.