From ba068d64b414f5e3cb00af291a9a0894c8c70172 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 8 Feb 2008 15:53:57 +0300 Subject: [PATCH] Silence the slow log errors (they won't make it to the client anyway). --- sql/log.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 06f4e2d7b78..1a3c98da60b 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -501,11 +501,13 @@ bool Log_to_csv_event_handler:: bool result= TRUE; bool need_close= FALSE; bool need_rnd_end= FALSE; + Silence_log_table_errors error_handler; Open_tables_state open_tables_backup; CHARSET_INFO *client_cs= thd->variables.character_set_client; bool save_time_zone_used; DBUG_ENTER("Log_to_csv_event_handler::log_slow"); + thd->push_internal_handler(& error_handler); /* CSV uses TIME_to_timestamp() internally if table needs to be repaired which will set thd->time_zone_used @@ -635,8 +637,11 @@ bool Log_to_csv_event_handler:: result= FALSE; err: + thd->pop_internal_handler(); + if (result) - sql_print_error("Failed to write to mysql.slow_log"); + sql_print_error("Failed to write to mysql.slow_log: %s", + error_handler.message()); if (need_rnd_end) {