mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-19404: Assertion failure on !is_thread_specific || (mysqld_server_initialized && thd)
In wsrep_plugins_post_init we iterate all theads and if they are galera appliers (wsrep_applier) we init session variables. However, current_thd was not set and recent changes on session variables require holding LOCK_gloal_system_variables mutex.
This commit is contained in:
@ -4342,13 +4342,19 @@ void wsrep_plugins_post_init()
|
|||||||
THD *thd;
|
THD *thd;
|
||||||
I_List_iterator<THD> it(threads);
|
I_List_iterator<THD> it(threads);
|
||||||
|
|
||||||
|
DBUG_ASSERT(!current_thd);
|
||||||
|
|
||||||
|
mysql_mutex_lock(&LOCK_global_system_variables);
|
||||||
|
|
||||||
while ((thd= it++))
|
while ((thd= it++))
|
||||||
{
|
{
|
||||||
if (IF_WSREP(thd->wsrep_applier,1))
|
if (thd->wsrep_applier)
|
||||||
{
|
{
|
||||||
// Save options_bits as it will get overwritten in plugin_thdvar_init()
|
// Save options_bits as it will get overwritten in
|
||||||
|
// plugin_thdvar_init() (verified)
|
||||||
ulonglong option_bits_saved= thd->variables.option_bits;
|
ulonglong option_bits_saved= thd->variables.option_bits;
|
||||||
|
|
||||||
|
set_current_thd(thd);
|
||||||
plugin_thdvar_init(thd);
|
plugin_thdvar_init(thd);
|
||||||
|
|
||||||
// Restore option_bits
|
// Restore option_bits
|
||||||
@ -4356,6 +4362,8 @@ void wsrep_plugins_post_init()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mysql_mutex_unlock(&LOCK_global_system_variables);
|
||||||
|
set_current_thd(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* WITH_WSREP */
|
#endif /* WITH_WSREP */
|
||||||
|
Reference in New Issue
Block a user