1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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.
This commit is contained in:
Alfranio Correia
2010-06-01 15:39:07 +01:00
parent ff6cf4bb46
commit ebde6f6de0
3 changed files with 56 additions and 8 deletions

View File

@@ -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.