diff options
author | Alexander Nozdrin <alik@sun.com> | 2010-02-15 14:16:49 +0300 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2010-02-15 14:16:49 +0300 |
commit | 6c32fa735717e91a1de369bc8fe7d73ef9ff224a (patch) | |
tree | 2c79edc43ff38be4c2de71e4fee4285523f5c08c /sql/sp.cc | |
parent | 0ec868ca0e2d3ea60835d7c8fa7b951182b497b1 (diff) | |
parent | 2fa7509bf07761e041c5702f3b833b7fefb3ec61 (diff) | |
download | mariadb-git-6c32fa735717e91a1de369bc8fe7d73ef9ff224a.tar.gz |
Manual merge from mysql-next-mr.
Conflicts:
- sql/log_event.cc
- sql/sql_class.h
Diffstat (limited to 'sql/sp.cc')
-rw-r--r-- | sql/sp.cc | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sql/sp.cc b/sql/sp.cc index 680538d33e9..39a8b6a009f 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -928,8 +928,8 @@ sp_create_routine(THD *thd, int type, sp_head *sp) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); /* Grab an exclusive MDL lock. */ if (lock_routine_name(thd, type == TYPE_ENUM_FUNCTION, @@ -1144,7 +1144,9 @@ done: close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); } @@ -1182,8 +1184,8 @@ sp_drop_routine(THD *thd, int type, sp_name *name) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); /* Grab an exclusive MDL lock. */ if (lock_routine_name(thd, type == TYPE_ENUM_FUNCTION, @@ -1221,7 +1223,9 @@ sp_drop_routine(THD *thd, int type, sp_name *name) close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); } @@ -1266,8 +1270,8 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics) row-based replication. The flag will be reset at the end of the statement. */ - save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); - thd->clear_current_stmt_binlog_format_row(); + if ((save_binlog_row_based= thd->is_current_stmt_binlog_format_row())) + thd->clear_current_stmt_binlog_format_row(); if (!(table= open_proc_table_for_update(thd))) DBUG_RETURN(SP_OPEN_TABLE_FAILED); @@ -1326,7 +1330,9 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics) err: close_thread_tables(thd); /* Restore the state of binlog format */ - thd->current_stmt_binlog_row_based= save_binlog_row_based; + DBUG_ASSERT(!thd->is_current_stmt_binlog_format_row()); + if (save_binlog_row_based) + thd->set_current_stmt_binlog_format_row(); DBUG_RETURN(ret); } |