Commit 2b4b857d authored by Kristian Nielsen's avatar Kristian Nielsen

MDEV-6120: When slave stops with error, error message should indicate the failing GTID

Follow-up patch. The original patch added an extra argument to the
rli->report() function, however it was forgotten to adjust the calls
accordingly in a few places.

This patch updates the remaining calls as needed. In files log_event_old.cc
and rpl_record_old.cc, it just adds NULL, since this is only for old event
formats from ancient master servers, which would not have any GTID information
to add to the error messages in any case.
parent d2098b96
......@@ -108,7 +108,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, rpl_group_info *rgi)
Error reporting borrowed from Query_log_event with many excessive
simplifications (we don't honour --slave-skip-errors)
*/
rli->report(ERROR_LEVEL, actual_error,
rli->report(ERROR_LEVEL, actual_error, NULL,
"Error '%s' on opening tables",
(actual_error ? ev_thd->get_stmt_da()->message() :
"unexpected success or fatal error"));
......@@ -233,7 +233,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, rpl_group_info *rgi)
break;
default:
rli->report(ERROR_LEVEL, ev_thd->get_stmt_da()->sql_errno(),
rli->report(ERROR_LEVEL, ev_thd->get_stmt_da()->sql_errno(), NULL,
"Error in %s event: row application failed. %s",
ev->get_type_str(),
ev_thd->is_error() ? ev_thd->get_stmt_da()->message() : "");
......@@ -250,7 +250,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, rpl_group_info *rgi)
if (error)
{ /* error has occured during the transaction */
rli->report(ERROR_LEVEL, ev_thd->get_stmt_da()->sql_errno(),
rli->report(ERROR_LEVEL, ev_thd->get_stmt_da()->sql_errno(), NULL,
"Error in %s event: error during transaction execution "
"on table %s.%s. %s",
ev->get_type_str(), table->s->db.str,
......@@ -1498,7 +1498,7 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
simplifications (we don't honour --slave-skip-errors)
*/
uint actual_error= thd->net.last_errno;
rli->report(ERROR_LEVEL, actual_error,
rli->report(ERROR_LEVEL, actual_error, NULL,
"Error '%s' in %s event: when locking tables",
(actual_error ? thd->net.last_error :
"unexpected success or fatal error"),
......@@ -1507,7 +1507,7 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
}
else
{
rli->report(ERROR_LEVEL, error,
rli->report(ERROR_LEVEL, error, NULL,
"Error in %s event: when locking tables",
get_type_str());
}
......@@ -1653,7 +1653,7 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
break;
default:
rli->report(ERROR_LEVEL, thd->net.last_errno,
rli->report(ERROR_LEVEL, thd->net.last_errno, NULL,
"Error in %s event: row application failed. %s",
get_type_str(),
thd->net.last_error ? thd->net.last_error : "");
......@@ -1691,7 +1691,7 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
if (error)
{ /* error has occured during the transaction */
rli->report(ERROR_LEVEL, thd->net.last_errno,
rli->report(ERROR_LEVEL, thd->net.last_errno, NULL,
"Error in %s event: error during transaction execution "
"on table %s.%s. %s",
get_type_str(), table->s->db.str,
......@@ -1774,7 +1774,7 @@ int Old_rows_log_event::do_apply_event(rpl_group_info *rgi)
*/
DBUG_ASSERT(! thd->transaction_rollback_request);
if ((error= (binlog_error ? trans_rollback_stmt(thd) : trans_commit_stmt(thd))))
rli->report(ERROR_LEVEL, error,
rli->report(ERROR_LEVEL, error, NULL,
"Error in %s event: commit of row events failed, "
"table `%s`.`%s`",
get_type_str(), m_table->s->db.str,
......
......@@ -317,6 +317,7 @@ unpack_row(rpl_group_info *rgi,
if (!pack_ptr)
{
rgi->rli->report(ERROR_LEVEL, ER_SLAVE_CORRUPT_EVENT,
rgi->gtid_info(),
"Could not read field '%s' of table '%s.%s'",
f->field_name, table->s->db.str,
table->s->table_name.str);
......
......@@ -141,7 +141,7 @@ unpack_row_old(rpl_group_info *rgi,
f->move_field_offset(-offset);
if (!ptr)
{
rgi->rli->report(ERROR_LEVEL, ER_SLAVE_CORRUPT_EVENT,
rgi->rli->report(ERROR_LEVEL, ER_SLAVE_CORRUPT_EVENT, NULL,
"Could not read field `%s` of table `%s`.`%s`",
f->field_name, table->s->db.str,
table->s->table_name.str);
......@@ -183,7 +183,7 @@ unpack_row_old(rpl_group_info *rgi,
if (event_type == WRITE_ROWS_EVENT &&
((*field_ptr)->flags & mask) == mask)
{
rgi->rli->report(ERROR_LEVEL, ER_NO_DEFAULT_FOR_FIELD,
rgi->rli->report(ERROR_LEVEL, ER_NO_DEFAULT_FOR_FIELD, NULL,
"Field `%s` of table `%s`.`%s` "
"has no default value and cannot be NULL",
(*field_ptr)->field_name, table->s->db.str,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment