Bug #53421 Part of transaction not written in binlog after deadlock, replication breaks
| Submitted: | 4 May 2010 20:28 | Modified: | 13 Jul 2010 9:11 |
|---|---|---|---|
| Reporter: | Elena Stepanova | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
| Version: | 5.5.5-m3, 5.6.99-m4 | OS: | Any |
| Assigned to: | Alfranio Tavares Correia Junior | CPU Architecture: | Any |
| Tags: | regression | ||
[4 May 2010 20:28]
Elena Stepanova
[11 May 2010 23:38]
Alfranio Tavares Correia Junior
Hi all,
Find a fix for this bug below:
=== modified file 'sql/sql_parse.cc'
--- sql/sql_parse.cc 2010-04-26 09:02:29 +0000
+++ sql/sql_parse.cc 2010-05-11 23:26:48 +0000
@@ -2655,6 +2655,10 @@
*/
lex->unlink_first_table(&link_to_local);
+ /* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */
+ if (create_info.options & HA_LEX_CREATE_TMP_TABLE)
+ thd->variables.option_bits|= OPTION_KEEP_LOG;
+
/*
select_create is currently not re-execution friendly and
needs to be created for every execution of a PS/SP.
[12 May 2010 13:25]
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/108136 3038 Alfranio Correia 2010-05-12 BUG#53421 Part of transaction not written in binlog after deadlock, replication breaks When a "CREATE TEMPORARY TABLE SELECT * FROM" was executed the OPTION_KEEP_LOG was not set into the thd->variables.option_bits. For that reason, if the transaction had updated only transactional engines and was rolled back at the end (.e.g due to a deadlock) the changes were not written to the binary log, including the creation of the temporary table. To fix the problem, we have set the OPTION_KEEP_LOG into the thd->variables.option_bits when a "CREATE TEMPORARY TABLE SELECT * FROM" is executed.
[1 Jun 2010 14:39]
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/109790 3086 Alfranio Correia 2010-06-01 BUG#53421 Part of transaction not written in binlog after deadlock, replication breaks When a "CREATE TEMPORARY TABLE SELECT * FROM" was executed the OPTION_KEEP_LOG was not set into the thd->variables.option_bits. For that reason, if the transaction had updated only transactional engines and was rolled back at the end (.e.g due to a deadlock) the changes were not written to the binary log, including the creation of the temporary table. To fix the problem, we have set the OPTION_KEEP_LOG into the thd->variables.option_bits when a "CREATE TEMPORARY TABLE SELECT * FROM" is executed.
[1 Jun 2010 19:35]
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/109803 3088 Alfranio Correia 2010-06-01 Post-merge fix for BUG#53421.
[15 Jun 2010 8:12]
Bugs System
Pushed into 5.5.5-m3 (revid:alik@sun.com-20100615080459-smuswd9ooeywcxuc) (version source revid:marko.makela@oracle.com-20100601134335-ccthwwru23kn09qw) (merge vers: 5.1.48) (pib:16)
[15 Jun 2010 8:28]
Bugs System
Pushed into mysql-next-mr (revid:alik@sun.com-20100615080558-cw01bzdqr1bdmmec) (version source revid:marko.makela@oracle.com-20100601134335-ccthwwru23kn09qw) (pib:16)
[13 Jul 2010 9:11]
Jon Stephens
Documented bugfix in the 5.5.5 changelog as follows:
When a CREATE TEMPORARY TABLE ... SELECT statement was executed
within a transaction that updated only transactional engines and
was later rolled back (for example, due to a deadlock) the
changes--including the creation of the temporary table--were not
written to the binary log, which caused subsequent updates to this
table to fail on the slave.
Closed.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.064 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.