summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/table_cache.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/sql/table_cache.cc b/sql/table_cache.cc
index af22c67044b..8b768240b4f 100644
--- a/sql/table_cache.cc
+++ b/sql/table_cache.cc
@@ -332,8 +332,6 @@ static TABLE *tc_acquire_table(THD *thd, TABLE_SHARE *share)
mysql_mutex_lock(&share->tdc.LOCK_table_share);
table= share->tdc.free_tables.pop_front();
- mysql_mutex_unlock(&share->tdc.LOCK_table_share);
-
if (table)
{
DBUG_ASSERT(!table->in_use);
@@ -343,6 +341,7 @@ static TABLE *tc_acquire_table(THD *thd, TABLE_SHARE *share)
/* The children must be detached from the table. */
DBUG_ASSERT(!table->file->extra(HA_EXTRA_IS_ATTACHED_CHILDREN));
}
+ mysql_mutex_unlock(&share->tdc.LOCK_table_share);
return table;
}