mirror of
https://github.com/MariaDB/server.git
synced 2026-04-23 08:45:33 +02:00
MDEV-6616 Server crashes in my_hash_first if shutdown is performed when FLUSH LOGS is running
master_info_index becomes zero during shutdown. check that it's valid (under a mutex) before dereferencing.
This commit is contained in:
parent
9392d0e280
commit
3da761912a
6 changed files with 61 additions and 32 deletions
|
|
@ -3961,9 +3961,13 @@ longlong Item_master_pos_wait::val_int()
|
|||
else
|
||||
connection_name= thd->variables.default_master_connection;
|
||||
|
||||
if (!(mi= master_info_index->get_master_info(&connection_name,
|
||||
Sql_condition::WARN_LEVEL_WARN)))
|
||||
mysql_mutex_lock(&LOCK_active_mi);
|
||||
mi= master_info_index->get_master_info(&connection_name,
|
||||
Sql_condition::WARN_LEVEL_WARN);
|
||||
mysql_mutex_unlock(&LOCK_active_mi);
|
||||
if (!mi)
|
||||
goto err;
|
||||
|
||||
if ((event_count = mi->rli.wait_for_pos(thd, log_name, pos, timeout)) == -2)
|
||||
{
|
||||
null_value = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue