diff options
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/sql/log.cc b/sql/log.cc index bb81d0c723e..fd2b686fb50 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -80,23 +80,28 @@ public: virtual ~Silence_log_table_errors() {} - virtual bool handle_error(uint sql_errno, const char *message, - MYSQL_ERROR::enum_warning_level level, - THD *thd); + virtual bool handle_condition(THD *thd, + uint sql_errno, + const char* sql_state, + MYSQL_ERROR::enum_warning_level level, + const char* msg, + MYSQL_ERROR ** cond_hdl); const char *message() const { return m_message; } }; bool -Silence_log_table_errors::handle_error(uint /* sql_errno */, - const char *message_arg, - MYSQL_ERROR::enum_warning_level /* level */, - THD * /* thd */) -{ - strmake(m_message, message_arg, sizeof(m_message)-1); +Silence_log_table_errors::handle_condition(THD *, + uint, + const char*, + MYSQL_ERROR::enum_warning_level, + const char* msg, + MYSQL_ERROR ** cond_hdl) +{ + *cond_hdl= NULL; + strmake(m_message, msg, sizeof(m_message)-1); return TRUE; } - sql_print_message_func sql_print_message_handlers[3] = { sql_print_information, @@ -1646,7 +1651,7 @@ bool MYSQL_BIN_LOG::check_write_error(THD *thd) if (!thd->is_error()) DBUG_RETURN(checked); - switch (thd->main_da.sql_errno()) + switch (thd->stmt_da->sql_errno()) { case ER_TRANS_CACHE_FULL: case ER_ERROR_ON_WRITE: @@ -2902,7 +2907,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd) } else { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_BINLOG_PURGE_FATAL_ERR, "a problem with deleting %s; " "consider examining correspondence " @@ -2933,7 +2938,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd) } else { - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_BINLOG_PURGE_FATAL_ERR, "a problem with deleting %s; " "consider examining correspondence " @@ -3264,7 +3269,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, */ if (thd) { - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_BINLOG_PURGE_FATAL_ERR, "a problem with getting info on being purged %s; " "consider examining correspondence " @@ -3310,7 +3315,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, { if (thd) { - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_BINLOG_PURGE_FATAL_ERR, "a problem with deleting %s; " "consider examining correspondence " @@ -3409,7 +3414,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) */ if (thd) { - push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_BINLOG_PURGE_FATAL_ERR, "a problem with getting info on being purged %s; " "consider examining correspondence " @@ -4419,9 +4424,9 @@ int query_error_code(THD *thd, bool not_killed) if (not_killed) { - error= thd->is_error() ? thd->main_da.sql_errno() : 0; + error= thd->is_error() ? thd->stmt_da->sql_errno() : 0; - /* thd->main_da.sql_errno() might be ER_SERVER_SHUTDOWN or + /* thd->stmt_da->sql_errno() might be ER_SERVER_SHUTDOWN or ER_QUERY_INTERRUPTED, So here we need to make sure that error is not set to these errors when specified not_killed by the caller. |