summaryrefslogtreecommitdiff
path: root/storage/spider/spd_trx.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/spider/spd_trx.cc')
-rw-r--r--storage/spider/spd_trx.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
index e832c2bc450..0023a5d4bbc 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -103,7 +103,6 @@ int spider_free_trx_conn(SPIDER_TRX *trx, bool trx_free)
HASH *conn_hash= &trx->trx_conn_hash;
DBUG_ENTER("spider_free_trx_conn");
- DBUG_ASSERT(!trx_free || !trx->locked_connections);
/* Clear the connection queues in any case. */
while ((conn= (SPIDER_CONN *) my_hash_element(conn_hash, loop_count)))
@@ -114,11 +113,16 @@ int spider_free_trx_conn(SPIDER_TRX *trx, bool trx_free)
if (trx_free || spider_param_conn_recycle_mode(trx->thd) != 2)
{
- /* Free connections only when no connection is locked. */
- if (!trx->locked_connections)
+ loop_count= 0;
+ while ((conn= (SPIDER_CONN *) my_hash_element(&trx->trx_conn_hash,
+ loop_count)))
{
- loop_count= 0;
- while ((conn= (SPIDER_CONN *) my_hash_element(conn_hash, loop_count)))
+ if (conn->table_lock)
+ {
+ DBUG_ASSERT(!trx_free);
+ loop_count++;
+ }
+ else
{
spider_free_conn_from_trx(trx, conn, FALSE, trx_free, &loop_count);
}