diff options
author | tsmith@ramayana.hindu.god <> | 2007-10-10 14:00:57 -0600 |
---|---|---|
committer | tsmith@ramayana.hindu.god <> | 2007-10-10 14:00:57 -0600 |
commit | ced64f85823c7a9dcd6b9f952c136278567fa9f6 (patch) | |
tree | f1931f4b6b596a733e55a7ecbea7f547d7aa4611 /sql | |
parent | e2bfd46b42d98a78dcd0be48228962a486ada522 (diff) | |
download | mariadb-git-ced64f85823c7a9dcd6b9f952c136278567fa9f6.tar.gz |
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.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_class.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index b67f63778dc..4a98a044e25 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2241,8 +2241,11 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) void mark_transaction_to_rollback(THD *thd, bool all) { - thd->is_fatal_sub_stmt_error= TRUE; - thd->transaction_rollback_request= all; + if (thd) + { + thd->is_fatal_sub_stmt_error= TRUE; + thd->transaction_rollback_request= all; + } } /*************************************************************************** Handling of XA id cacheing |