diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-11-19 13:16:25 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-11-19 13:16:25 +0100 |
commit | fa3f8a18b247d5d7d86d60d016681cc188522f80 (patch) | |
tree | 180232f5e13c81e22ae9374b41be168ed9578932 /sql/sql_admin.cc | |
parent | efab095c7f8f044525ce7d2313fad5f86032baab (diff) | |
parent | 543b6e02246db25d8a61574fc709b28e7720d1a0 (diff) | |
download | mariadb-git-fa3f8a18b247d5d7d86d60d016681cc188522f80.tar.gz |
mysql-5.5.34 merge
(some patches reverted, test case added)
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r-- | sql/sql_admin.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 5b947401f56..b8a7afbd6c5 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -900,8 +900,20 @@ send_result_message: } } /* Error path, a admin command failed. */ - trans_commit_stmt(thd); - trans_commit_implicit(thd); + if (thd->transaction_rollback_request) + { + /* + Unlikely, but transaction rollback was requested by one of storage + engines (e.g. due to deadlock). Perform it. + */ + if (trans_rollback_stmt(thd) || trans_rollback_implicit(thd)) + goto err; + } + else + { + if (trans_commit_stmt(thd) || trans_commit_implicit(thd)) + goto err; + } close_thread_tables(thd); thd->mdl_context.release_transactional_locks(); |