summaryrefslogtreecommitdiff
path: root/sql/event_db_repository.cc
diff options
context:
space:
mode:
author <Dao-Gang.Qu@sun.com>2010-01-22 17:38:21 +0800
committer <Dao-Gang.Qu@sun.com>2010-01-22 17:38:21 +0800
commit25a436bdc4a043bc7adb842c009d30d2130c13d2 (patch)
tree38a04f7b1df366f29044950c701f98334c2d062b /sql/event_db_repository.cc
parent0482b6ebca43fa168550005ecb7f94e3c0729923 (diff)
downloadmariadb-git-25a436bdc4a043bc7adb842c009d30d2130c13d2.tar.gz
Bug #49132 Replication failure on temporary table + DDL
In RBR, DDL statement will change binlog format to non row-based format before it is binlogged, but the binlog format was not be restored, and then manipulating a temporary table can not reset binlog format to row-based format rightly. So that the manipulated statement is binlogged with statement-based format. To fix the problem, restore the state of binlog format after the DDL statement is binlogged.
Diffstat (limited to 'sql/event_db_repository.cc')
-rw-r--r--sql/event_db_repository.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc
index 9f3863eb2b0..753e9d21b65 100644
--- a/sql/event_db_repository.cc
+++ b/sql/event_db_repository.cc
@@ -1045,6 +1045,7 @@ update_timing_fields_for_event(THD *thd,
TABLE *table= NULL;
Field **fields;
int ret= 1;
+ bool save_binlog_row_based;
DBUG_ENTER("Event_db_repository::update_timing_fields_for_event");
@@ -1052,8 +1053,8 @@ update_timing_fields_for_event(THD *thd,
Turn off row binlogging of event timing updates. These are not used
for RBR of events replicated to the slave.
*/
- if (thd->current_stmt_binlog_row_based)
- thd->clear_current_stmt_binlog_row_based();
+ save_binlog_row_based= thd->current_stmt_binlog_row_based;
+ thd->clear_current_stmt_binlog_row_based();
DBUG_ASSERT(thd->security_ctx->master_access & SUPER_ACL);
@@ -1095,6 +1096,8 @@ update_timing_fields_for_event(THD *thd,
end:
if (table)
close_thread_tables(thd);
+ /* Restore the state of binlog format */
+ thd->current_stmt_binlog_row_based= save_binlog_row_based;
DBUG_RETURN(test(ret));
}