summaryrefslogtreecommitdiff
path: root/storage/innobase/trx/trx0sys.c
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2011-04-11 17:03:32 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2011-04-11 17:03:32 +0300
commit460a7197bb0bda8401f947e30d6aec2b4acb9fb3 (patch)
treeb851fa825337e1df319fa715979f0d3387378863 /storage/innobase/trx/trx0sys.c
parent3dc70ced6f3a36c3a8a161d0040f389680cc6263 (diff)
parent12fbe05c6a31a7958a4a1cae748477027fffa51f (diff)
downloadmariadb-git-460a7197bb0bda8401f947e30d6aec2b4acb9fb3.tar.gz
Merge mysql-5.1-innodb to mysql-5.5-innodb.
Diffstat (limited to 'storage/innobase/trx/trx0sys.c')
-rw-r--r--storage/innobase/trx/trx0sys.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/storage/innobase/trx/trx0sys.c b/storage/innobase/trx/trx0sys.c
index 7af9fbb1af8..8e595353024 100644
--- a/storage/innobase/trx/trx0sys.c
+++ b/storage/innobase/trx/trx0sys.c
@@ -37,6 +37,7 @@ Created 3/26/1996 Heikki Tuuri
#include "trx0rseg.h"
#include "trx0undo.h"
#include "srv0srv.h"
+#include "srv0start.h"
#include "trx0purge.h"
#include "log0log.h"
#include "log0recv.h"
@@ -1617,10 +1618,12 @@ void
trx_sys_close(void)
/*===============*/
{
+ trx_t* trx;
trx_rseg_t* rseg;
read_view_t* view;
ut_ad(trx_sys != NULL);
+ ut_ad(srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS);
/* Check that all read views are closed except read view owned
by a purge. */
@@ -1652,6 +1655,13 @@ trx_sys_close(void)
mem_free(trx_doublewrite);
trx_doublewrite = NULL;
+ /* Only prepared transactions may be left in the system. Free them. */
+ ut_a(UT_LIST_GET_LEN(trx_sys->trx_list) == trx_n_prepared);
+
+ while ((trx = UT_LIST_GET_FIRST(trx_sys->trx_list)) != NULL) {
+ trx_free_prepared(trx);
+ }
+
/* There can't be any active transactions. */
rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);