Bug #29570 original error lost in write_event on slave

- make sure error gets propagated to thd->net by calling print_error
- also print the full error message
parent 5659314a
......@@ -6057,8 +6057,9 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
default:
slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno,
"Error in %s event: row application failed",
get_type_str());
"Error in %s event: row application failed. %s",
get_type_str(),
thd->net.last_error ? thd->net.last_error : "");
thd->query_error= 1;
break;
}
......@@ -6079,9 +6080,10 @@ int Rows_log_event::do_apply_event(RELAY_LOG_INFO const *rli)
{ /* error has occured during the transaction */
slave_print_msg(ERROR_LEVEL, rli, thd->net.last_errno,
"Error in %s event: error during transaction execution "
"on table %s.%s",
"on table %s.%s. %s",
get_type_str(), table->s->db.str,
table->s->table_name.str);
table->s->table_name.str,
thd->net.last_error ? thd->net.last_error : "");
/*
If one day we honour --skip-slave-errors in row-based replication, and
......@@ -6997,7 +6999,12 @@ replace_record(THD *thd, TABLE *table,
}
if ((keynum= table->file->get_dup_key(error)) < 0)
{
/* We failed to retrieve the duplicate key */
table->file->print_error(error, MYF(0));
/*
We failed to retrieve the duplicate key
- either because the error was not "duplicate key" error
- or because the information which key is not available
*/
DBUG_RETURN(error);
}
......
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