Switch automaticly to statement based replication for statements that can't generate row based events. This is needed to avoid getting

updates to system, statistics and admin tables logged to binary log.
- Removed special code used to temporarily change to statement based replication.
- Changed to a faster and smaller interface for temporarily switching to statement based replication.

sql/event_db_repository.cc:
  Change to new interface to not use row based replication for system table changes.
sql/events.cc:
  Change to new interface to not use row based replication for system table changes.
sql/sp.cc:
  Removed temporarily switching to statement based replication (this is now done automaticly in mysql_execute_command())
sql/sql_acl.cc:
  Change to new interface to not use row based replication for system table changes.
  Removed temporarily switching to statement based replication (this is now done automaticly in mysql_execute_command())
sql/sql_class.h:
  Added new interface for temporarily switching to statement based replication.
sql/sql_parse.cc:
  Mark commands that needs original replication mode with CF_FORCE_ORIGINAL_BINLOG_FORMAT.
  Switch automaticly to statement based replication for statements that can't generate row based events (and can't change replication mode)
sql/sql_udf.cc:
  Removed temporarily switching to statement based replication (this is now done automaticly in mysql_execute_command())
This commit is contained in:
Michael Widenius 2012-09-04 19:26:30 +03:00
commit 5139238685
7 changed files with 108 additions and 277 deletions

View file

@ -1112,17 +1112,15 @@ update_timing_fields_for_event(THD *thd,
TABLE *table= NULL;
Field **fields;
int ret= 1;
bool save_binlog_row_based;
enum_binlog_format save_binlog_format;
MYSQL_TIME time;
DBUG_ENTER("Event_db_repository::update_timing_fields_for_event");
/*
Turn off row binlogging of event timing updates. These are not used
for RBR of events replicated to the slave.
*/
if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row()))
thd->clear_current_stmt_binlog_format_row();
save_binlog_format= thd->set_current_stmt_binlog_format_stmt();
DBUG_ASSERT(thd->security_ctx->master_access & SUPER_ACL);
@ -1157,10 +1155,7 @@ end:
if (table)
close_mysql_tables(thd);
/* Restore the state of binlog format */
DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row());
if (save_binlog_row_based)
thd->set_current_stmt_binlog_format_row();
thd->restore_stmt_binlog_format(save_binlog_format);
DBUG_RETURN(test(ret));
}