From 262dadccf112eae2381def6e6e144da2ffa9036f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Feb 2005 20:18:21 +0300 Subject: Fix for bug #6572: SHOW ERRORS doesn't --- sql/protocol.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sql/protocol.cc') diff --git a/sql/protocol.cc b/sql/protocol.cc index 95cd8415c85..4cecd016553 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -58,6 +58,7 @@ void send_error(THD *thd, uint sql_errno, const char *err) uint length; char buff[MYSQL_ERRMSG_SIZE+2], *pos; #endif + const char *orig_err= err; NET *net= &thd->net; DBUG_ENTER("send_error"); DBUG_PRINT("enter",("sql_errno: %d err: %s", sql_errno, @@ -82,6 +83,7 @@ void send_error(THD *thd, uint sql_errno, const char *err) err=ER(sql_errno); /* purecov: inspected */ } } + orig_err= err; } #ifdef EMBEDDED_LIBRARY @@ -120,6 +122,8 @@ void send_error(THD *thd, uint sql_errno, const char *err) } VOID(net_write_command(net,(uchar) 255, "", 0, (char*) err,length)); #endif /* EMBEDDED_LIBRARY*/ + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, sql_errno, + orig_err ? orig_err : ER(sql_errno)); thd->is_fatal_error=0; // Error message is given thd->net.report_error= 0; @@ -247,6 +251,8 @@ net_printf(THD *thd, uint errcode, ...) strmake(net->last_error, text_pos, length); strmake(net->sqlstate, mysql_errno_to_sqlstate(errcode), SQLSTATE_LENGTH); #endif + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, errcode, + text_pos ? text_pos : ER(errcode)); thd->is_fatal_error=0; // Error message is given DBUG_VOID_RETURN; } -- cgit v1.2.1