mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
BUG#51021: current_stmt_binlog_row_based not removed in next-mr
Deployed DBUG_ASSERT before the conditional binlog format restore.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user