Commit ed312cb5 authored by unknown's avatar unknown

Give a more informative message if we failed to write to mysql.general_log

table.

parent ee0b7f38
...@@ -73,23 +73,28 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all); ...@@ -73,23 +73,28 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all);
*/ */
class Silence_log_table_errors : public Internal_error_handler class Silence_log_table_errors : public Internal_error_handler
{ {
char m_message[MYSQL_ERRMSG_SIZE];
public: public:
Silence_log_table_errors() Silence_log_table_errors()
{} {
m_message[0]= '\0';
}
virtual ~Silence_log_table_errors() {} virtual ~Silence_log_table_errors() {}
virtual bool handle_error(uint sql_errno, const char *message, virtual bool handle_error(uint sql_errno, const char *message,
MYSQL_ERROR::enum_warning_level level, MYSQL_ERROR::enum_warning_level level,
THD *thd); THD *thd);
const char *message() const { return m_message; }
}; };
bool bool
Silence_log_table_errors::handle_error(uint /* sql_errno */, Silence_log_table_errors::handle_error(uint /* sql_errno */,
const char * /* message */, const char *message_arg,
MYSQL_ERROR::enum_warning_level /* level */, MYSQL_ERROR::enum_warning_level /* level */,
THD * /* thd */) THD * /* thd */)
{ {
strmake(m_message, message_arg, sizeof(m_message));
return TRUE; return TRUE;
} }
...@@ -437,7 +442,8 @@ bool Log_to_csv_event_handler:: ...@@ -437,7 +442,8 @@ bool Log_to_csv_event_handler::
err: err:
if (result) if (result)
sql_print_error("Failed to write to mysql.general_log"); sql_print_error("Failed to write to mysql.general_log: %s",
error_handler.message());
if (need_rnd_end) if (need_rnd_end)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment