summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2002-08-05 22:18:39 +0300
committerunknown <monty@narttu.mysql.fi>2002-08-05 22:18:39 +0300
commit3cf7c3e68bae80f753196e8bb38d8cced9adb324 (patch)
tree49e4d4daefba1e0a52502e97ecda432875546fb3 /sql/sql_base.cc
parent529e1af2957828c4b8570933547b7202c8a36878 (diff)
parentccf728776349a95fbeaeac58a825949040f20a55 (diff)
downloadmariadb-git-3cf7c3e68bae80f753196e8bb38d8cced9adb324.tar.gz
merge
BitKeeper/etc/logging_ok: auto-union sql/sql_base.cc: Auto merged
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index a40587bb8c9..cba64418355 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -279,6 +279,16 @@ void intern_close_table(TABLE *table)
VOID(closefrm(table)); // close file
}
+/*
+ Remove table from the open table cache
+
+ SYNOPSIS
+ free_cache_entry()
+ table Table to remove
+
+ NOTE
+ We need to have a lock on LOCK_open when calling this
+*/
static void free_cache_entry(TABLE *table)
{
@@ -833,7 +843,10 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
/* make a new table */
if (!(table=(TABLE*) my_malloc(sizeof(*table),MYF(MY_WME))))
+ {
+ VOID(pthread_mutex_unlock(&LOCK_open));
DBUG_RETURN(NULL);
+ }
if (open_unireg_entry(thd, table,db,table_name,alias,1) ||
!(table->table_cache_key=memdup_root(&table->mem_root,(char*) key,
key_length)))
@@ -1181,7 +1194,6 @@ bool wait_for_tables(THD *thd)
/* Now we can open all tables without any interference */
thd->proc_info="Reopen tables";
result=reopen_tables(thd,0,0);
-
}
pthread_mutex_unlock(&LOCK_open);
thd->proc_info=0;
@@ -1372,9 +1384,9 @@ int open_tables(THD *thd,TABLE_LIST *start)
}
}
*prev_table=0;
+ pthread_mutex_unlock(&LOCK_open);
if (found)
VOID(pthread_cond_broadcast(&COND_refresh)); // Signal to refresh
- pthread_mutex_unlock(&LOCK_open);
goto restart;
}
result= -1; // Fatal error