Commit 6094d190 authored by Jon Olav Hauglid's avatar Jon Olav Hauglid

Bug#13586591 RQG GRAMMAR CONF/ENGINES/ENGINE_STRESS.YY

             CRASHES INNODB | TRX_STATE_NOT_STARTED

The problem was that if DELETE with subselect caused a
deadlock inside InnoDB, this deadlock was not properly
handled by the SQL layer. This meant that the SQL layer
would try to unlock the row after InnoDB had rolled
back the transaction. This caused an assertion inside
InnoDB.

This patch fixes the problem by checking for errors
reported by SQL_SELECT::skip_record() and not calling
unlock_row() if any errors have been reported.
parent db982ec8
......@@ -341,8 +341,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
break;
}
}
else
/*
Don't try unlocking the row if skip_record reported an error since in
this case the transaction might have been rolled back already.
*/
else if (!thd->is_error())
table->file->unlock_row(); // Row failed selection, release lock on it
else
break;
}
killed_status= thd->killed;
if (killed_status != THD::NOT_KILLED || thd->is_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