mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Merge branch '10.0' into 10.1
This commit is contained in:
@@ -9249,84 +9249,6 @@ my_bool mysql_rm_tmp_tables(void)
|
||||
unireg support functions
|
||||
*****************************************************************************/
|
||||
|
||||
/**
|
||||
A callback to the server internals that is used to address
|
||||
special cases of the locking protocol.
|
||||
Invoked when acquiring an exclusive lock, for each thread that
|
||||
has a conflicting shared metadata lock.
|
||||
|
||||
This function:
|
||||
- aborts waiting of the thread on a data lock, to make it notice
|
||||
the pending exclusive lock and back off.
|
||||
- if the thread is an INSERT DELAYED thread, sends it a KILL
|
||||
signal to terminate it.
|
||||
|
||||
@note This function does not wait for the thread to give away its
|
||||
locks. Waiting is done outside for all threads at once.
|
||||
|
||||
@param thd Current thread context
|
||||
@param in_use The thread to wake up
|
||||
@param needs_thr_lock_abort Indicates that to wake up thread
|
||||
this call needs to abort its waiting
|
||||
on table-level lock.
|
||||
|
||||
@retval TRUE if the thread was woken up
|
||||
@retval FALSE otherwise.
|
||||
|
||||
@note It is one of two places where border between MDL and the
|
||||
rest of the server is broken.
|
||||
*/
|
||||
|
||||
bool mysql_notify_thread_having_shared_lock(THD *thd, THD *in_use,
|
||||
bool needs_thr_lock_abort)
|
||||
{
|
||||
bool signalled= FALSE;
|
||||
if ((in_use->system_thread & SYSTEM_THREAD_DELAYED_INSERT) &&
|
||||
!in_use->killed)
|
||||
{
|
||||
in_use->set_killed(KILL_SYSTEM_THREAD);
|
||||
mysql_mutex_lock(&in_use->mysys_var->mutex);
|
||||
if (in_use->mysys_var->current_cond)
|
||||
{
|
||||
mysql_mutex_lock(in_use->mysys_var->current_mutex);
|
||||
mysql_cond_broadcast(in_use->mysys_var->current_cond);
|
||||
mysql_mutex_unlock(in_use->mysys_var->current_mutex);
|
||||
}
|
||||
mysql_mutex_unlock(&in_use->mysys_var->mutex);
|
||||
signalled= TRUE;
|
||||
}
|
||||
|
||||
if (needs_thr_lock_abort)
|
||||
{
|
||||
mysql_mutex_lock(&in_use->LOCK_thd_data);
|
||||
for (TABLE *thd_table= in_use->open_tables;
|
||||
thd_table ;
|
||||
thd_table= thd_table->next)
|
||||
{
|
||||
/*
|
||||
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->needs_reopen())
|
||||
{
|
||||
signalled|= mysql_lock_abort_for_thread(thd, thd_table);
|
||||
if (thd && WSREP(thd) && wsrep_thd_is_BF(thd, true))
|
||||
{
|
||||
WSREP_DEBUG("remove_table_from_cache: %llu",
|
||||
(unsigned long long) thd->real_id);
|
||||
wsrep_abort_thd((void *)thd, (void *)in_use, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
mysql_mutex_unlock(&in_use->LOCK_thd_data);
|
||||
}
|
||||
return signalled;
|
||||
}
|
||||
|
||||
|
||||
int setup_ftfuncs(SELECT_LEX *select_lex)
|
||||
{
|
||||
List_iterator<Item_func_match> li(*(select_lex->ftfunc_list)),
|
||||
|
||||
Reference in New Issue
Block a user