mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
WL#3015: Logging Improvements - No Restarts(ver N4)
Added slow_query_log & general_log global upadatable variables. Added slow-query-log & general-log startup options. Added log_output, general_log_file, slow_query_log_file global updatable variables.
This commit is contained in:
@ -931,7 +931,8 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
|
||||
/* close log tables in use */
|
||||
if (!my_strcasecmp(system_charset_info, table_list->db, "mysql"))
|
||||
{
|
||||
if (!my_strcasecmp(system_charset_info, table_list->table_name,
|
||||
if (opt_log &&
|
||||
!my_strcasecmp(system_charset_info, table_list->table_name,
|
||||
"general_log"))
|
||||
{
|
||||
lock_logger= 1;
|
||||
@ -940,7 +941,8 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
|
||||
closed_log_tables= closed_log_tables | QUERY_LOG_GENERAL;
|
||||
}
|
||||
else
|
||||
if (!my_strcasecmp(system_charset_info, table_list->table_name,
|
||||
if (opt_slow_log &&
|
||||
!my_strcasecmp(system_charset_info, table_list->table_name,
|
||||
"slow_log"))
|
||||
{
|
||||
lock_logger= 1;
|
||||
@ -981,10 +983,10 @@ end:
|
||||
unlock_table_name(thd, table_list);
|
||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||
|
||||
if (closed_log_tables & QUERY_LOG_SLOW)
|
||||
if (opt_slow_log && (closed_log_tables & QUERY_LOG_SLOW))
|
||||
logger.reopen_log_table(QUERY_LOG_SLOW);
|
||||
|
||||
if (closed_log_tables & QUERY_LOG_GENERAL)
|
||||
if (opt_log && (closed_log_tables & QUERY_LOG_GENERAL))
|
||||
logger.reopen_log_table(QUERY_LOG_GENERAL);
|
||||
if (lock_logger)
|
||||
logger.unlock();
|
||||
|
Reference in New Issue
Block a user