diff options
author | Luis Soares <luis.soares@sun.com> | 2010-02-10 16:01:31 +0000 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2010-02-10 16:01:31 +0000 |
commit | 563ba7db9b09618c277634fa9431db65414ba942 (patch) | |
tree | 912b2d6400869607c582535593820f78cb2eb992 /sql | |
parent | 06df9b073d072307adb5ae3334cc3ccb2df24e32 (diff) | |
download | mariadb-git-563ba7db9b09618c277634fa9431db65414ba942.tar.gz |
BUG#51021: current_stmt_binlog_row_based not removed in next-mr
Deployed DBUG_ASSERT before the conditional binlog format
restore.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/event_db_repository.cc | 1 | ||||
-rw-r--r-- | sql/events.cc | 4 | ||||
-rw-r--r-- | sql/sp.cc | 3 | ||||
-rw-r--r-- | sql/sql_acl.cc | 18 | ||||
-rw-r--r-- | sql/sql_udf.cc | 6 |
5 files changed, 32 insertions, 0 deletions
diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 50e556af84f..ff74dd0ab84 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -1097,6 +1097,7 @@ end: if (table) close_thread_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(); diff --git a/sql/events.cc b/sql/events.cc index b5855401368..340ef8c7bd2 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -377,6 +377,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, sql_print_error("Event Error: An error occurred while creating query string, " "before writing it into binary log."); /* 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(TRUE); @@ -388,6 +389,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, } mysql_mutex_unlock(&LOCK_event_metadata); /* 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(); @@ -511,6 +513,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, } mysql_mutex_unlock(&LOCK_event_metadata); /* 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(); @@ -588,6 +591,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) } mysql_mutex_unlock(&LOCK_event_metadata); /* 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); diff --git a/sql/sp.cc b/sql/sp.cc index de379e7e725..aae825c6c0d 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -1136,6 +1136,7 @@ done: close_thread_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(); DBUG_RETURN(ret); @@ -1195,6 +1196,7 @@ sp_drop_routine(THD *thd, int type, sp_name *name) close_thread_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(); DBUG_RETURN(ret); @@ -1271,6 +1273,7 @@ sp_update_routine(THD *thd, int type, sp_name *name, st_sp_chistics *chistics) close_thread_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(); DBUG_RETURN(ret); diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index f0499cb3a5b..334d6474169 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3137,6 +3137,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, if (!(thd->spcont || rpl_filter->tables_ok(0, tables))) { /* 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(FALSE); @@ -3154,6 +3155,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, { // Should never happen close_thread_tables(thd); /* purecov: deadcode */ /* 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(TRUE); /* purecov: deadcode */ @@ -3283,6 +3285,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, /* Tables are automatically closed */ thd->lex->restore_backup_query_tables_list(&backup); /* 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(result); @@ -3367,6 +3370,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, if (!(thd->spcont || rpl_filter->tables_ok(0, tables))) { /* 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(FALSE); @@ -3378,6 +3382,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, { // Should never happen close_thread_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(); DBUG_RETURN(TRUE); @@ -3457,6 +3462,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, mysql_rwlock_unlock(&LOCK_grant); /* 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(); @@ -3520,6 +3526,7 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list, if (!(thd->spcont || rpl_filter->tables_ok(0, tables))) { /* 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(FALSE); @@ -3531,6 +3538,7 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list, { // This should never happen close_thread_tables(thd); /* purecov: deadcode */ /* 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(TRUE); /* purecov: deadcode */ @@ -3593,6 +3601,7 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list, if (!result) my_ok(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(); @@ -5813,6 +5822,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) if ((result= open_grant_tables(thd, tables))) { /* 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(result != 1); @@ -5860,6 +5870,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) mysql_rwlock_unlock(&LOCK_grant); close_thread_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(); DBUG_RETURN(result); @@ -5903,6 +5914,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list) if ((result= open_grant_tables(thd, tables))) { /* 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(result != 1); @@ -5944,6 +5956,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list) close_thread_tables(thd); thd->variables.sql_mode= old_sql_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(result); @@ -5987,6 +6000,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list) if ((result= open_grant_tables(thd, tables))) { /* 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(result != 1); @@ -6038,6 +6052,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list) mysql_rwlock_unlock(&LOCK_grant); close_thread_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(); DBUG_RETURN(result); @@ -6078,6 +6093,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list) if ((result= open_grant_tables(thd, tables))) { /* 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(result != 1); @@ -6235,6 +6251,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list) if (result && !binlog_error) my_message(ER_REVOKE_GRANTS, ER(ER_REVOKE_GRANTS), MYF(0)); /* 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(); @@ -6383,6 +6400,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, thd->pop_internal_handler(); /* 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(); diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 10ef34e0b3a..80c4791ab21 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -533,11 +533,13 @@ int mysql_create_function(THD *thd,udf_func *udf) if (write_bin_log(thd, TRUE, thd->query(), thd->query_length())) { /* 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(1); } /* 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(0); @@ -547,6 +549,7 @@ int mysql_create_function(THD *thd,udf_func *udf) dlclose(dl); mysql_rwlock_unlock(&THR_LOCK_udf); /* 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(1); @@ -620,17 +623,20 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) if (write_bin_log(thd, TRUE, thd->query(), thd->query_length())) { /* 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(1); } /* 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(0); err: mysql_rwlock_unlock(&THR_LOCK_udf); /* 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(1); |