summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2003-07-02 01:57:40 +0300
committerunknown <heikki@hundin.mysql.fi>2003-07-02 01:57:40 +0300
commit593c6d9a3af872ea42ce812026e184e3f72994fa (patch)
treeae7e134980fc735850c84776c5a12fb9216636a6
parenta2dfa95277052dea989cedadfb898dd18dc06534 (diff)
downloadmariadb-git-593c6d9a3af872ea42ce812026e184e3f72994fa.tar.gz
ha_innodb.cc:
Remove still some potential hangs over the btr0sea.c semaphore sql/ha_innodb.cc: Remove still some potential hangs over the btr0sea.c semaphore
-rw-r--r--sql/ha_innodb.cc38
1 files changed, 25 insertions, 13 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 3f534f8d6e7..8924ff3a97d 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -663,6 +663,8 @@ ha_innobase::init_table_handle_for_HANDLER(void)
prebuilt = (row_prebuilt_t*)innobase_prebuilt;
+ innobase_release_stat_resources(prebuilt->trx);
+
/* If the transaction is not started yet, start it */
trx_start_if_not_started_noninline(prebuilt->trx);
@@ -1206,6 +1208,12 @@ innobase_savepoint(
trx = check_trx_exists(thd);
+ /* Release a possible FIFO ticket and search latch. Since we will
+ reserve the kernel mutex, we have to release the search system latch
+ first to obey the latching order. */
+
+ innobase_release_stat_resources(trx);
+
/* Setting a savepoint starts a transaction inside InnoDB since
it allocates resources for it (memory to store the savepoint name,
for example) */
@@ -1219,26 +1227,28 @@ innobase_savepoint(
}
/*********************************************************************
-Frees a possible InnoDB trx object associated with the current
-THD. */
+Frees a possible InnoDB trx object associated with the current THD. */
int
innobase_close_connection(
/*======================*/
- /* out: 0 or error number */
- THD* thd) /* in: handle to the MySQL thread of the user
- whose transaction should be rolled back */
+ /* out: 0 or error number */
+ THD* thd) /* in: handle to the MySQL thread of the user
+ whose transaction should be rolled back */
{
- if (NULL != thd->transaction.all.innobase_tid) {
+ trx_t* trx;
- trx_rollback_for_mysql((trx_t*)
- (thd->transaction.all.innobase_tid));
- trx_free_for_mysql((trx_t*)
- (thd->transaction.all.innobase_tid));
- thd->transaction.all.innobase_tid = NULL;
- }
+ trx = (trx_t*)thd->transaction.all.innobase_tid;
- return(0);
+ if (NULL != trx) {
+ innobase_rollback(thd, (void*)trx);
+
+ trx_free_for_mysql(trx);
+
+ thd->transaction.all.innobase_tid = NULL;
+ }
+
+ return(0);
}
/**********************************************************************
@@ -1497,6 +1507,8 @@ ha_innobase::close(void)
/*====================*/
/* out: error number */
{
+ trx_t* trx;
+
DBUG_ENTER("ha_innobase::close");
row_prebuilt_free((row_prebuilt_t*) innobase_prebuilt);