ha_innodb.cc:

  Remove still some potential hangs over the btr0sea.c semaphore
parent 5dedab55
......@@ -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,8 +1227,7 @@ 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(
......@@ -1229,12 +1236,15 @@ innobase_close_connection(
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 = (trx_t*)thd->transaction.all.innobase_tid;
if (NULL != trx) {
innobase_rollback(thd, (void*)trx);
trx_free_for_mysql(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;
}
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment