summaryrefslogtreecommitdiff
path: root/sql/sql_admin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_admin.cc')
-rw-r--r--sql/sql_admin.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 8c11886998e..f2523b44317 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -1175,7 +1175,9 @@ send_result_message:
}
else
{
- if (trans_commit_stmt(thd) || trans_commit_implicit(thd))
+ if (trans_commit_stmt(thd) ||
+ (stmt_causes_implicit_commit(thd, CF_IMPLICIT_COMMIT_END) &&
+ trans_commit_implicit(thd)))
goto err;
}
close_thread_tables(thd);
@@ -1209,7 +1211,8 @@ send_result_message:
err:
/* Make sure this table instance is not reused after the failure. */
trans_rollback_stmt(thd);
- trans_rollback(thd);
+ if (stmt_causes_implicit_commit(thd, CF_IMPLICIT_COMMIT_END))
+ trans_rollback(thd);
if (table && table->table)
{
table->table->m_needs_reopen= true;