summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-08-26 00:34:43 +0200
committerSergei Golubchik <serg@mariadb.org>2017-08-26 00:34:43 +0200
commitbb8e99fdc367a470c6195a2ae4c33f273fe55a25 (patch)
tree3b3bcacec8faab66bf6756f20dff1e45462fdc1c /sql/log_event.cc
parentadd44e684cb9f1b46d1d5facdf6255360fa7b656 (diff)
parentc02d61bc11ee06b6043e6db9a15d00b9f40bce1f (diff)
downloadmariadb-git-bb8e99fdc367a470c6195a2ae4c33f273fe55a25.tar.gz
Merge branch 'bb-10.2-ext' into 10.3
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc21
1 files changed, 7 insertions, 14 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index caec38a0554..73987a562fa 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -390,12 +390,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;
@@ -5060,7 +5054,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);
@@ -5281,7 +5275,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(),
@@ -5363,7 +5357,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();
@@ -6842,8 +6836,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());
@@ -6853,7 +6846,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
@@ -10957,7 +10950,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;
@@ -11009,7 +11002,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)