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.
This commit is contained in:
Jon Olav Hauglid 2012-06-12 15:04:57 +02:00
parent 46ca66b9f8
commit 6aab1cecec

View file

@ -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())