summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2009-06-25 12:25:23 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2009-06-25 12:25:23 -0300
commit4c1333e6edc45bd10a23fa836f82d8b59d623fd5 (patch)
treec6433c113369ef43f4c39e0e54181893939bd2c5 /sql/handler.cc
parentcbfcafd4849807e71076f7fb866a896b74f6f79b (diff)
downloadmariadb-git-4c1333e6edc45bd10a23fa836f82d8b59d623fd5.tar.gz
Bug#45548: XA transaction without access to InnoDB tables crashes the server
The problem is that the one phase commit function failed to properly end a empty transaction. The solution is to ensure that the transaction cleanup procedure is invoked even for empty transactions.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 7e584b8fcf3..e65ceba4181 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1242,9 +1242,10 @@ int ha_commit_one_phase(THD *thd, bool all)
#endif
thd->variables.tx_isolation=thd->session_tx_isolation;
}
- if (is_real_trans)
- thd->transaction.cleanup();
}
+ /* Free resources and perform other cleanup even for 'empty' transactions. */
+ if (is_real_trans)
+ thd->transaction.cleanup();
#endif /* USING_TRANSACTIONS */
DBUG_RETURN(error);
}