diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-11-23 00:50:54 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-11-23 00:50:54 +0100 |
commit | c6d30805db3a1a2a098c3009fde8a42efd9fb9de (patch) | |
tree | e55f68e5adf40e1a75e08bda91b712ab6a094643 /sql/sp_head.cc | |
parent | 2c032b990e4ec470fad2e9f61cf6267a68b7e937 (diff) | |
parent | eea310e498f3b7ac95a4492d48f04e08d3009412 (diff) | |
download | mariadb-git-c6d30805db3a1a2a098c3009fde8a42efd9fb9de.tar.gz |
5.5 merge
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 122b6c9b796..80d4f4c8e9f 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1,5 +1,6 @@ /* - Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2002, 2013, Oracle and/or its affiliates. + Copyright (c) 2011, 2013, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2183,10 +2184,18 @@ sp_head::execute_procedure(THD *thd, List<Item> *args) close_thread_tables(thd); thd_proc_info(thd, 0); - if (! thd->in_sub_stmt && ! thd->in_multi_stmt_transaction_mode()) - thd->mdl_context.release_transactional_locks(); - else if (! thd->in_sub_stmt) - thd->mdl_context.release_statement_locks(); + if (! thd->in_sub_stmt) + { + if (thd->transaction_rollback_request) + { + trans_rollback_implicit(thd); + thd->mdl_context.release_transactional_locks(); + } + else if (! thd->in_multi_stmt_transaction_mode()) + thd->mdl_context.release_transactional_locks(); + else + thd->mdl_context.release_statement_locks(); + } thd->rollback_item_tree_changes(); @@ -3041,10 +3050,18 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp, close_thread_tables(thd); thd_proc_info(thd, 0); - if (! thd->in_sub_stmt && ! thd->in_multi_stmt_transaction_mode()) - thd->mdl_context.release_transactional_locks(); - else if (! thd->in_sub_stmt) - thd->mdl_context.release_statement_locks(); + if (! thd->in_sub_stmt) + { + if (thd->transaction_rollback_request) + { + trans_rollback_implicit(thd); + thd->mdl_context.release_transactional_locks(); + } + else if (! thd->in_multi_stmt_transaction_mode()) + thd->mdl_context.release_transactional_locks(); + else + thd->mdl_context.release_statement_locks(); + } } //TODO: why is this here if log_slow_query is in sp_instr_stmt_execute? delete_explain_query(m_lex); |