1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge with next-4284.

This commit is contained in:
Konstantin Osipov
2009-12-11 13:39:45 +03:00
18 changed files with 415 additions and 120 deletions

View File

@ -1534,8 +1534,8 @@ bool close_thread_table(THD *thd, TABLE **table_ptr)
*table_ptr=table->next;
table->mdl_ticket= NULL;
if (table->needs_reopen() ||
thd->version != refresh_version || !table->db_stat ||
if (table->s->needs_reopen() ||
thd->version != refresh_version || table->needs_reopen() ||
table_def_shutdown_in_progress)
{
free_cache_entry(table);
@ -2844,7 +2844,8 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
table exists now we should downgrade our exclusive metadata
lock on this table to shared metadata lock.
*/
if (table_list->lock_strategy == TABLE_LIST::EXCLUSIVE_DOWNGRADABLE_MDL)
if (table_list->lock_strategy == TABLE_LIST::EXCLUSIVE_DOWNGRADABLE_MDL &&
!(flags & MYSQL_OPEN_HAS_MDL_LOCK))
mdl_ticket->downgrade_exclusive_lock();
table->mdl_ticket= mdl_ticket;
@ -8190,13 +8191,13 @@ bool mysql_notify_thread_having_shared_lock(THD *thd, THD *in_use)
thd_table= thd_table->next)
{
/*
Check for TABLE::db_stat is needed since in some places we call
Check for TABLE::needs_reopen() is needed since in some places we call
handler::close() for table instance (and set TABLE::db_stat to 0)
and do not remove such instances from the THD::open_tables
for some time, during which other thread can see those instances
(e.g. see partitioning code).
*/
if (thd_table->db_stat)
if (!thd_table->needs_reopen())
signalled|= mysql_lock_abort_for_thread(thd, thd_table);
}
pthread_mutex_unlock(&LOCK_open);