Commit 80ace294 authored by unknown's avatar unknown

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.


sql/sql_class.cc:
  It is possible that mark_transaction_to_rollback() may be
  called in rare circumstances when thd is NULL (e.g., from
  some calls to convert_error_code_to_mysql()).  Don't use thd
  if it is NULL.
parent e33a069c
...@@ -2241,8 +2241,11 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) ...@@ -2241,8 +2241,11 @@ 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
......
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