Bug #20499 | mixed mode with temporary table breaks binlog | ||
---|---|---|---|
Submitted: | 16 Jun 2006 12:12 | Modified: | 24 Jul 2006 17:56 |
Reporter: | Guilhem Bichot | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 5.1-bk | OS: | Linux (linux) |
Assigned to: | Guilhem Bichot | CPU Architecture: | Any |
[16 Jun 2006 12:12]
Guilhem Bichot
[16 Jun 2006 13:19]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/7760
[16 Jun 2006 14:32]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/7766
[5 Jul 2006 12:14]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/8752
[11 Jul 2006 8:38]
Guilhem Bichot
Pushed in replication team tree 5.1, will be in 5.1.12. Bug happened in such cases, in mixed binlogging mode: CREATE TEMPORARY TABLE t1 SELECT UUID(); # UUID => binlogged row-based # automatically switches back to statement-based create table t2 like t1; # a normal table INSERT INTO t2 SELECT * FROM t1; # statement-based The last statement depends on t1. But t1's creation was binlogged row-based, and for temp tables, row-based binlogging writes nothing to binlog (as expected). So the last statement didn't insert any data on slave. Fix is that we don't automatically switch back to statement-based if the session has temp tables. ChangeSet guilhem@gbichot3.local|ChangeSet|20060709150047|19215 2006/07/09 17:00:47+02:00 guilhem@gbichot3.local +15 -0 * Mixed replication mode * : ... 3) Fix for BUG#20499 "mixed mode with temporary table breaks binlog": a temporary table containing e.g. UUID has its changes not binlogged, so any query updating a permanent table with data from the temporary table will run wrongly on slave. Solution: in mixed mode we don't switch back from row-based to statement-based when there exists temporary tables.
[24 Jul 2006 17:56]
Paul DuBois
Noted in 5.1.12 changelog. In mixed binary logging mode, storing into a temporary table a row that uses a function that causes a switch to row-based binary logging, the temporary table's data was not logged. Consequently, selecting from the table into a non-temporary table would would work on the master but not the slave.