@@ -3137,6 +3137,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
3137
3137
if (!(thd->spcont || rpl_filter->tables_ok (0 , tables)))
3138
3138
{
3139
3139
/* Restore the state of binlog format */
3140
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
3140
3141
if (save_binlog_row_based)
3141
3142
thd->set_current_stmt_binlog_format_row ();
3142
3143
DBUG_RETURN (FALSE );
@@ -3154,6 +3155,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
3154
3155
{ // Should never happen
3155
3156
close_thread_tables (thd); /* purecov: deadcode */
3156
3157
/* Restore the state of binlog format */
3158
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
3157
3159
if (save_binlog_row_based)
3158
3160
thd->set_current_stmt_binlog_format_row ();
3159
3161
DBUG_RETURN (TRUE ); /* purecov: deadcode */
@@ -3283,6 +3285,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
3283
3285
/* Tables are automatically closed */
3284
3286
thd->lex ->restore_backup_query_tables_list (&backup);
3285
3287
/* Restore the state of binlog format */
3288
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
3286
3289
if (save_binlog_row_based)
3287
3290
thd->set_current_stmt_binlog_format_row ();
3288
3291
DBUG_RETURN (result);
@@ -3367,6 +3370,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
3367
3370
if (!(thd->spcont || rpl_filter->tables_ok (0 , tables)))
3368
3371
{
3369
3372
/* Restore the state of binlog format */
3373
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
3370
3374
if (save_binlog_row_based)
3371
3375
thd->set_current_stmt_binlog_format_row ();
3372
3376
DBUG_RETURN (FALSE );
@@ -3378,6 +3382,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
3378
3382
{ // Should never happen
3379
3383
close_thread_tables (thd);
3380
3384
/* Restore the state of binlog format */
3385
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
3381
3386
if (save_binlog_row_based)
3382
3387
thd->set_current_stmt_binlog_format_row ();
3383
3388
DBUG_RETURN (TRUE );
@@ -3457,6 +3462,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc,
3457
3462
3458
3463
mysql_rwlock_unlock (&LOCK_grant);
3459
3464
/* Restore the state of binlog format */
3465
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
3460
3466
if (save_binlog_row_based)
3461
3467
thd->set_current_stmt_binlog_format_row ();
3462
3468
@@ -3520,6 +3526,7 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
3520
3526
if (!(thd->spcont || rpl_filter->tables_ok (0 , tables)))
3521
3527
{
3522
3528
/* Restore the state of binlog format */
3529
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
3523
3530
if (save_binlog_row_based)
3524
3531
thd->set_current_stmt_binlog_format_row ();
3525
3532
DBUG_RETURN (FALSE );
@@ -3531,6 +3538,7 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
3531
3538
{ // This should never happen
3532
3539
close_thread_tables (thd); /* purecov: deadcode */
3533
3540
/* Restore the state of binlog format */
3541
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
3534
3542
if (save_binlog_row_based)
3535
3543
thd->set_current_stmt_binlog_format_row ();
3536
3544
DBUG_RETURN (TRUE ); /* purecov: deadcode */
@@ -3593,6 +3601,7 @@ bool mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
3593
3601
if (!result)
3594
3602
my_ok (thd);
3595
3603
/* Restore the state of binlog format */
3604
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
3596
3605
if (save_binlog_row_based)
3597
3606
thd->set_current_stmt_binlog_format_row ();
3598
3607
@@ -5813,6 +5822,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
5813
5822
if ((result= open_grant_tables (thd, tables)))
5814
5823
{
5815
5824
/* Restore the state of binlog format */
5825
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
5816
5826
if (save_binlog_row_based)
5817
5827
thd->set_current_stmt_binlog_format_row ();
5818
5828
DBUG_RETURN (result != 1 );
@@ -5860,6 +5870,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list)
5860
5870
mysql_rwlock_unlock (&LOCK_grant);
5861
5871
close_thread_tables (thd);
5862
5872
/* Restore the state of binlog format */
5873
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
5863
5874
if (save_binlog_row_based)
5864
5875
thd->set_current_stmt_binlog_format_row ();
5865
5876
DBUG_RETURN (result);
@@ -5903,6 +5914,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
5903
5914
if ((result= open_grant_tables (thd, tables)))
5904
5915
{
5905
5916
/* Restore the state of binlog format */
5917
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
5906
5918
if (save_binlog_row_based)
5907
5919
thd->set_current_stmt_binlog_format_row ();
5908
5920
DBUG_RETURN (result != 1 );
@@ -5944,6 +5956,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list)
5944
5956
close_thread_tables (thd);
5945
5957
thd->variables .sql_mode = old_sql_mode;
5946
5958
/* Restore the state of binlog format */
5959
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
5947
5960
if (save_binlog_row_based)
5948
5961
thd->set_current_stmt_binlog_format_row ();
5949
5962
DBUG_RETURN (result);
@@ -5987,6 +6000,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
5987
6000
if ((result= open_grant_tables (thd, tables)))
5988
6001
{
5989
6002
/* Restore the state of binlog format */
6003
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
5990
6004
if (save_binlog_row_based)
5991
6005
thd->set_current_stmt_binlog_format_row ();
5992
6006
DBUG_RETURN (result != 1 );
@@ -6038,6 +6052,7 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list)
6038
6052
mysql_rwlock_unlock (&LOCK_grant);
6039
6053
close_thread_tables (thd);
6040
6054
/* Restore the state of binlog format */
6055
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
6041
6056
if (save_binlog_row_based)
6042
6057
thd->set_current_stmt_binlog_format_row ();
6043
6058
DBUG_RETURN (result);
@@ -6078,6 +6093,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
6078
6093
if ((result= open_grant_tables (thd, tables)))
6079
6094
{
6080
6095
/* Restore the state of binlog format */
6096
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
6081
6097
if (save_binlog_row_based)
6082
6098
thd->set_current_stmt_binlog_format_row ();
6083
6099
DBUG_RETURN (result != 1 );
@@ -6235,6 +6251,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list)
6235
6251
if (result && !binlog_error)
6236
6252
my_message (ER_REVOKE_GRANTS, ER (ER_REVOKE_GRANTS), MYF (0 ));
6237
6253
/* Restore the state of binlog format */
6254
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
6238
6255
if (save_binlog_row_based)
6239
6256
thd->set_current_stmt_binlog_format_row ();
6240
6257
@@ -6383,6 +6400,7 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name,
6383
6400
6384
6401
thd->pop_internal_handler ();
6385
6402
/* Restore the state of binlog format */
6403
+ DBUG_ASSERT (!thd->is_current_stmt_binlog_format_row ());
6386
6404
if (save_binlog_row_based)
6387
6405
thd->set_current_stmt_binlog_format_row ();
6388
6406
0 commit comments