From bbdec04d59ceeda7d1792c8250f6b10989cb239a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 12 Apr 2022 13:07:20 +0200 Subject: MDEV-24317 Data race in LOGGER::init_error_log at sql/log.cc:1443 and in LOGGER::error_log_print at sql/log.cc:1181 don't initialize error_log_handler_list in set_handlers() * error_log_handler_list is initialized to LOG_FILE early, in init_base() * set_handlers always reinitializes it to LOG_FILE, so it's pointless * after init_base() concurrent threads start using sql_log_warning, so following set_handlers() shouldn't modify error_log_handler_list without some protection --- sql/log.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'sql/log.cc') diff --git a/sql/log.cc b/sql/log.cc index 61cc922adb9..f6f3879e66d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1561,13 +1561,9 @@ bool Log_to_csv_event_handler::init() return 0; } -int LOGGER::set_handlers(ulonglong error_log_printer, - ulonglong slow_log_printer, +int LOGGER::set_handlers(ulonglong slow_log_printer, ulonglong general_log_printer) { - /* error log table is not supported yet */ - DBUG_ASSERT(error_log_printer < LOG_TABLE); - lock_exclusive(); if ((slow_log_printer & LOG_TABLE || general_log_printer & LOG_TABLE) && @@ -1580,7 +1576,6 @@ int LOGGER::set_handlers(ulonglong error_log_printer, "Falling back to the old-fashioned logs"); } - init_error_log(error_log_printer); init_slow_log(slow_log_printer); init_general_log(general_log_printer); -- cgit v1.2.1