diff options
author | Michael Widenius <monty@askmonty.org> | 2012-09-04 19:26:30 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2012-09-04 19:26:30 +0300 |
commit | 513923868545338c00390f35f63b92efd55f50bb (patch) | |
tree | 580f41a16d8d9b3d0b378c608f265cfdfca84658 /sql/sp.cc | |
parent | bc644de9a9d1126fbcbc67e90fe24cfa24147092 (diff) | |
download | mariadb-git-513923868545338c00390f35f63b92efd55f50bb.tar.gz |
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())
Diffstat (limited to 'sql/sp.cc')
-rw-r--r-- | sql/sp.cc | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/sql/sp.cc b/sql/sp.cc index 93cd64b4104..a1ff4db375b 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -984,9 +984,6 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp) enum_check_fields saved_count_cuted_fields; bool store_failed= FALSE; - - bool save_binlog_row_based; - DBUG_ENTER("sp_create_routine"); DBUG_PRINT("enter", ("type: %d name: %.*s", (int) type, (int) sp->m_name.length, @@ -1004,14 +1001,6 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp) /* Reset sql_mode during data dictionary operations. */ thd->variables.sql_mode= 0; - /* - This statement will be replicated as a statement, even when using - row-based replication. The flag will be reset at the end of the - statement. - */ - if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) - thd->clear_current_stmt_binlog_format_row(); - saved_count_cuted_fields= thd->count_cuted_fields; thd->count_cuted_fields= CHECK_FIELD_WARN; @@ -1217,10 +1206,7 @@ sp_create_routine(THD *thd, stored_procedure_type type, sp_head *sp) done: thd->count_cuted_fields= saved_count_cuted_fields; thd->variables.sql_mode= saved_mode; - /* 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(); DBUG_RETURN(ret); } @@ -1245,7 +1231,6 @@ sp_drop_routine(THD *thd, stored_procedure_type type, sp_name *name) { TABLE *table; int ret; - bool save_binlog_row_based; MDL_key::enum_mdl_namespace mdl_type= type == TYPE_ENUM_FUNCTION ? MDL_key::FUNCTION : MDL_key::PROCEDURE; DBUG_ENTER("sp_drop_routine"); @@ -1267,9 +1252,6 @@ sp_drop_routine(THD *thd, stored_procedure_type type, sp_name *name) row-based replication. The flag will be reset at the end of the statement. */ - if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) - thd->clear_current_stmt_binlog_format_row(); - if ((ret= db_find_routine_aux(thd, type, name, table)) == SP_OK) { if (table->file->ha_delete_row(table->record[0])) @@ -1296,10 +1278,7 @@ sp_drop_routine(THD *thd, stored_procedure_type type, sp_name *name) sp_cache_flush_obsolete(spc, &sp); } } - /* 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(); DBUG_RETURN(ret); } @@ -1327,7 +1306,6 @@ sp_update_routine(THD *thd, stored_procedure_type type, sp_name *name, { TABLE *table; int ret; - bool save_binlog_row_based; MDL_key::enum_mdl_namespace mdl_type= type == TYPE_ENUM_FUNCTION ? MDL_key::FUNCTION : MDL_key::PROCEDURE; DBUG_ENTER("sp_update_routine"); @@ -1345,14 +1323,6 @@ sp_update_routine(THD *thd, stored_procedure_type type, sp_name *name, if (!(table= open_proc_table_for_update(thd))) DBUG_RETURN(SP_OPEN_TABLE_FAILED); - /* - This statement will be replicated as a statement, even when using - row-based replication. The flag will be reset at the end of the - statement. - */ - if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) - thd->clear_current_stmt_binlog_format_row(); - if ((ret= db_find_routine_aux(thd, type, name, table)) == SP_OK) { if (type == TYPE_ENUM_FUNCTION && ! trust_function_creators && @@ -1406,10 +1376,7 @@ sp_update_routine(THD *thd, stored_procedure_type type, sp_name *name, sp_cache_invalidate(); } err: - /* 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(); DBUG_RETURN(ret); } |