1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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
This commit is contained in:
unknown
2002-08-05 18:50:38 +03:00
parent e2cf3f8e45
commit 7952914415
5 changed files with 43 additions and 7 deletions

View File

@ -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;