Skip to content

Commit 361ad4b

Browse files
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
1 parent d6d45fa commit 361ad4b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sql/sql_repl.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ bool log_in_use(const char* log_name)
248248
size_t log_name_len = strlen(log_name) + 1;
249249
THD *tmp;
250250
bool result = 0;
251-
DEBUG_SYNC(current_thd,"purge_logs_after_lock_index_before_thread_count");
251+
#ifndef BDUG_OFF
252+
if (current_thd)
253+
DEBUG_SYNC(current_thd,"purge_logs_after_lock_index_before_thread_count");
254+
#endif
252255
mysql_mutex_lock(&LOCK_thread_count);
253256
I_List_iterator<THD> it(threads);
254257

0 commit comments

Comments
 (0)