summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 41a76007289..5010d115a6c 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -490,11 +490,14 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
char *db= table_list->db ? table_list->db : (thd->db ? thd->db : (char*) "");
uint key_length;
DBUG_ENTER("lock_table_name");
+ DBUG_PRINT("enter",("db: %s name: %s", db, table_list->real_name));
+
safe_mutex_assert_owner(&LOCK_open);
key_length=(uint) (strmov(strmov(key,db)+1,table_list->real_name)
-key)+ 1;
+
/* Only insert the table if we haven't insert it already */
for (table=(TABLE*) hash_search(&open_cache,(byte*) key,key_length) ;
table ;
@@ -526,6 +529,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN(0);
}
+
void unlock_table_name(THD *thd, TABLE_LIST *table_list)
{
if (table_list->table)
@@ -535,6 +539,7 @@ void unlock_table_name(THD *thd, TABLE_LIST *table_list)
}
}
+
static bool locked_named_table(THD *thd, TABLE_LIST *table_list)
{
for (; table_list ; table_list=table_list->next)