diff options
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 4265a23df2b..92885344cd6 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -371,12 +371,6 @@ static void pretty_print_str(IO_CACHE* cache, const char* str, int len) #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) -static void clear_all_errors(THD *thd, Relay_log_info *rli) -{ - thd->is_slave_error = 0; - thd->clear_error(); -} - inline int idempotent_error_code(int err_code) { int ret= 0; @@ -4255,7 +4249,7 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi, DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos)); - clear_all_errors(thd, const_cast<Relay_log_info*>(rli)); + thd->clear_error(1); current_stmt_is_commit= is_commit(); DBUG_ASSERT(!current_stmt_is_commit || !rgi->tables_to_lock); @@ -4475,7 +4469,7 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi, to check/fix it. */ if (mysql_test_parse_for_slave(thd, thd->query(), thd->query_length())) - clear_all_errors(thd, const_cast<Relay_log_info*>(rli)); /* Can ignore query */ + thd->clear_error(1); else { rli->report(ERROR_LEVEL, expected_error, rgi->gtid_info(), @@ -4556,7 +4550,7 @@ compare_errors: ignored_error_code(actual_error)) { DBUG_PRINT("info",("error ignored")); - clear_all_errors(thd, const_cast<Relay_log_info*>(rli)); + thd->clear_error(1); if (actual_error == ER_QUERY_INTERRUPTED || actual_error == ER_CONNECTION_KILLED) thd->reset_killed(); @@ -6025,8 +6019,7 @@ int Load_log_event::do_apply_event(NET* net, rpl_group_info *rgi, new_db.str= (char *) rpl_filter->get_rewrite_db(db, &new_db.length); thd->set_db(new_db.str, new_db.length); DBUG_ASSERT(thd->query() == 0); - thd->is_slave_error= 0; - clear_all_errors(thd, const_cast<Relay_log_info*>(rli)); + thd->clear_error(1); /* see Query_log_event::do_apply_event() and BUG#13360 */ DBUG_ASSERT(!rgi->m_table_map.count()); @@ -6036,7 +6029,7 @@ int Load_log_event::do_apply_event(NET* net, rpl_group_info *rgi, */ lex_start(thd); thd->lex->local_file= local_fname; - thd->reset_for_next_command(); + thd->reset_for_next_command(0); // Errors are cleared above /* We test replicate_*_db rules. Note that we have already prepared @@ -10091,7 +10084,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) slave_rows_error_report(WARNING_LEVEL, error, rgi, thd, table, get_type_str(), RPL_LOG_NAME, (ulong) log_pos); - clear_all_errors(thd, const_cast<Relay_log_info*>(rli)); + thd->clear_error(1); error= 0; if (idempotent_error == 0) break; @@ -10143,7 +10136,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) slave_rows_error_report(WARNING_LEVEL, error, rgi, thd, table, get_type_str(), RPL_LOG_NAME, (ulong) log_pos); - clear_all_errors(thd, const_cast<Relay_log_info*>(rli)); + thd->clear_error(1); error= 0; } } // if (table) |