1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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.


mysql-test/r/show_check.result:
  WL#3015: Logging Improvements - No Restarts
  result fix
sql/log.cc:
  WL#3015: Logging Improvements - No Restarts
  added methods to LOGGER class
  void deactivate_log_handlers(THD* thd, uint log_type);
  bool activate_log_handlers(THD* thd, uint log_type);
  added methods to Log_to_file_event_handler:
  TABLE_LIST *get_mysql_slow_log()
  TABLE_LIST *get_mysql_log()
sql/log.h:
  WL#3015: Logging Improvements - No Restarts
  added methods to LOGGER class
  void deactivate_log_handlers(THD* thd, uint log_type);
  bool activate_log_handlers(THD* thd, uint log_type);
  added methods to Log_to_file_event_handler:
  TABLE_LIST *get_mysql_slow_log()
  TABLE_LIST *get_mysql_log()
sql/mysql_priv.h:
  WL#3015: Logging Improvements - No Restarts
sql/mysqld.cc:
  WL#3015: Logging Improvements - No Restarts
  added 'slow-query-log' & 'general-log' options
sql/set_var.cc:
  WL#3015: Logging Improvements - No Restarts
  added 'slow_query_log' & 'general_log' updatable variables
  added 'log_output', 'general_log_file', 'slow_query_log_file' updatable variables
sql/set_var.h:
  WL#3015: Logging Improvements - No Restarts
  new class sys_var_log_state
  new class sys_var_log_output
sql/share/errmsg.txt:
  WL#3015: Logging Improvements - No Restarts
  added error message
sql/sql_delete.cc:
  WL#3015: Logging Improvements - No Restarts
  'truncate table slow_log|general', keep status of logs
This commit is contained in:
unknown
2006-06-19 18:30:55 +05:00
parent 07703f17bd
commit 0c4e184bde
12 changed files with 757 additions and 65 deletions

View File

@ -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();