summaryrefslogtreecommitdiff
path: root/sql/sql_admin.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-11-23 00:50:54 +0100
committerSergei Golubchik <sergii@pisem.net>2013-11-23 00:50:54 +0100
commitc6d30805db3a1a2a098c3009fde8a42efd9fb9de (patch)
treee55f68e5adf40e1a75e08bda91b712ab6a094643 /sql/sql_admin.cc
parent2c032b990e4ec470fad2e9f61cf6267a68b7e937 (diff)
parenteea310e498f3b7ac95a4492d48f04e08d3009412 (diff)
downloadmariadb-git-c6d30805db3a1a2a098c3009fde8a42efd9fb9de.tar.gz
5.5 merge
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r--sql/sql_admin.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 0b2a939d0ba..852661d5915 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -980,8 +980,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();