Bug #31517: Potential crash due to access of NULL thd in mark_transaction_to_rollback()

Introduced in mark_transaction_to_rollback(), part of fix for bug 24989;
fix is to check thd for NULL before using it.
This commit is contained in:
tsmith@ramayana.hindu.god 2007-10-10 14:00:57 -06:00
parent e2bfd46b42
commit ced64f8582

View File

@ -2240,10 +2240,13 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
*/ */
void mark_transaction_to_rollback(THD *thd, bool all) void mark_transaction_to_rollback(THD *thd, bool all)
{
if (thd)
{ {
thd->is_fatal_sub_stmt_error= TRUE; thd->is_fatal_sub_stmt_error= TRUE;
thd->transaction_rollback_request= all; thd->transaction_rollback_request= all;
} }
}
/*************************************************************************** /***************************************************************************
Handling of XA id cacheing Handling of XA id cacheing
***************************************************************************/ ***************************************************************************/