summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2010-06-01 15:39:07 +0100
committerAlfranio Correia <alfranio.correia@sun.com>2010-06-01 15:39:07 +0100
commitebde6f6de03cab4414ec86bcc0e6444773490d99 (patch)
tree8c67178c7a46ca3c7c56425ddf8c053e9421f3bf /sql/sql_parse.cc
parentff6cf4bb462cf2d6fc0b761c40639f268eb0b5f5 (diff)
downloadmariadb-git-ebde6f6de03cab4414ec86bcc0e6444773490d99.tar.gz
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.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ed4390a23cb..90d0a52d40d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2670,6 +2670,10 @@ case SQLCOM_PREPARE:
*/
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.