Bug#19553099 EXPIRE_LOGS_DAYS=1 CRASH MYSQLD DURING RESTART, DBUG_SYNC(NULL, ...)

 - Restarting mysqld with --expire-log-days=1 triggers 'log_in_use()' to be called while current_thd is NULL.
 - Check current_thd before calling DEBUG_SYNC() to avoid passing NULL pointer to DEBUG_SYNC()
 - Wrap debug code construct inside #ifndef DBUG_OFF like in other parts of the file
parent d6d45fa3
...@@ -248,7 +248,10 @@ bool log_in_use(const char* log_name) ...@@ -248,7 +248,10 @@ bool log_in_use(const char* log_name)
size_t log_name_len = strlen(log_name) + 1; size_t log_name_len = strlen(log_name) + 1;
THD *tmp; THD *tmp;
bool result = 0; bool result = 0;
DEBUG_SYNC(current_thd,"purge_logs_after_lock_index_before_thread_count"); #ifndef BDUG_OFF
if (current_thd)
DEBUG_SYNC(current_thd,"purge_logs_after_lock_index_before_thread_count");
#endif
mysql_mutex_lock(&LOCK_thread_count); mysql_mutex_lock(&LOCK_thread_count);
I_List_iterator<THD> it(threads); I_List_iterator<THD> it(threads);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment