summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2002-08-05 18:50:38 +0300
committerunknown <monty@narttu.mysql.fi>2002-08-05 18:50:38 +0300
commit7952914415e351973d1a572827bb1679e5b7b89e (patch)
tree6883369fca2aebcf1dec08665dd0146a1ebc9303 /sql/sql_insert.cc
parente2cf3f8e4501befbae0f785a422cb832fb3466c2 (diff)
downloadmariadb-git-7952914415e351973d1a572827bb1679e5b7b89e.tar.gz
Added some missing mutex_locks() when manipulating the table cache.
This should fix some possible table cache corruptions when doing OPTIMIZE or REPAIR table when other threads are opening new tables. sql/sql_base.cc: Added missing mutex unlock on error condition sql/sql_insert.cc: Added TODO item sql/sql_show.cc: Added missing pthread_mutex_lock(&LOCK_open) when calling query_table_status(). sql/sql_table.cc: Added missing pthread_mutex_lock(&LOCK_open) when calling hash_delete(), unlock_table_name() and remove_table_from_cache(). BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 18100996f52..d1ec53d6590 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1419,6 +1419,11 @@ bool select_create::send_eof()
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
VOID(pthread_mutex_lock(&LOCK_open));
mysql_unlock_tables(thd, lock);
+ /*
+ TODO:
+ Check if we can remove the following two rows.
+ We should be able to just keep the table in the table cache.
+ */
if (!table->tmp_table)
hash_delete(&open_cache,(byte*) table);
lock=0; table=0;