1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03: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:
Sergei Golubchik
2014-09-06 08:33:56 +02:00
parent 9392d0e280
commit 3da761912a
6 changed files with 61 additions and 32 deletions

View File

@ -2693,6 +2693,9 @@ case SQLCOM_PREPARE:
goto error;
mysql_mutex_lock(&LOCK_active_mi);
if (!master_info_index)
goto error;
mi= master_info_index->get_master_info(&lex_mi->connection_name,
Sql_condition::WARN_LEVEL_NOTE);
@ -3150,7 +3153,7 @@ end_with_restore_list:
case SQLCOM_SLAVE_ALL_START:
{
mysql_mutex_lock(&LOCK_active_mi);
if (!master_info_index->start_all_slaves(thd))
if (master_info_index && !master_info_index->start_all_slaves(thd))
my_ok(thd);
mysql_mutex_unlock(&LOCK_active_mi);
break;
@ -3166,7 +3169,7 @@ end_with_restore_list:
goto error;
}
mysql_mutex_lock(&LOCK_active_mi);
if (!master_info_index->stop_all_slaves(thd))
if (master_info_index && !master_info_index->stop_all_slaves(thd))
my_ok(thd);
mysql_mutex_unlock(&LOCK_active_mi);
break;