Commit 3cd32a9b authored by Monty's avatar Monty

Remove extra (not needed) error from multi-table-update for killed query

If a multi-update query was killed because of timeout or a kill statement,
there was a chance the query returned the error "An error occurred in
multi-table update" instead of the right error, like
"Query execution was interrupted".
parent 23833dce
......@@ -3047,14 +3047,18 @@ bool multi_update::send_eof()
DBUG_ASSERT(trans_safe || !updated ||
thd->transaction.stmt.modified_non_trans_table);
if (likely(local_error != 0))
error_handled= TRUE; // to force early leave from ::abort_result_set()
if (unlikely(local_error > 0)) // if the above log write did not fail ...
if (unlikely(local_error))
{
/* Safety: If we haven't got an error before (can happen in do_updates) */
my_message(ER_UNKNOWN_ERROR, "An error occurred in multi-table update",
MYF(0));
error_handled= TRUE; // to force early leave from ::abort_result_set()
if (thd->killed == NOT_KILLED && !thd->get_stmt_da()->is_set())
{
/*
No error message was sent and query was not killed (in which case
mysql_execute_command() will send the error mesage).
*/
my_message(ER_UNKNOWN_ERROR, "An error occurred in multi-table update",
MYF(0));
}
DBUG_RETURN(TRUE);
}
......
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