diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log_event.cc | 6 | ||||
-rw-r--r-- | sql/sql_acl.cc | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index f8373202750..c0c3bd4acbe 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -5357,6 +5357,12 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi, thd->update_server_status(); log_slow_statement(thd); thd->lex->restore_set_statement_var(); + + /* + slave_expected_error can be reset if the targeted tables are ignored + by the replication filter + */ + expected_error= thd->slave_expected_error; } thd->variables.option_bits&= ~OPTION_MASTER_SQL_ERROR; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index f62dd5471eb..c1519d636ea 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1356,7 +1356,15 @@ class Grant_tables Rpl_filter *rpl_filter= thd->system_thread_info.rpl_sql_info->rpl_filter; if (rpl_filter->is_on() && !rpl_filter->tables_ok(0, &first_table_in_list->tl)) + { + /* + If an event is targeting an ignored table, clear the expected error + because the query will not be executed. + */ + thd->slave_expected_error= 0; + DBUG_RETURN(1); + } } #endif if (open_and_lock_tables(thd, &first_table_in_list->tl, FALSE, |