diff options
author | unknown <gluh@gluh.mysql.r18.ru> | 2005-02-23 20:22:51 +0300 |
---|---|---|
committer | unknown <gluh@gluh.mysql.r18.ru> | 2005-02-23 20:22:51 +0300 |
commit | e09a6c1a203e986b4c4d34cf8a8b72b39e4c573d (patch) | |
tree | d3e1cd2714c25ffbee749ae053b0f1cbfc11186c /sql/protocol.cc | |
parent | 272f78b533f98cd611d0be62538399e6f0839355 (diff) | |
parent | 262dadccf112eae2381def6e6e144da2ffa9036f (diff) | |
download | mariadb-git-e09a6c1a203e986b4c4d34cf8a8b72b39e4c573d.tar.gz |
Merge gluh.mysql.r18.ru:/home/gluh/MySQL-MERGE/mysql-4.1
into gluh.mysql.r18.ru:/home/gluh/MySQL-MERGE/mysql-5.0
mysql-test/r/warnings.result:
Auto merged
mysql-test/t/warnings.test:
Auto merged
sql/protocol.cc:
Auto merged
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r-- | sql/protocol.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index 657341b8bdc..b84d170873d 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -59,6 +59,7 @@ void net_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("net_send_error"); DBUG_PRINT("enter",("sql_errno: %d err: %s", sql_errno, @@ -85,6 +86,7 @@ void net_send_error(THD *thd, uint sql_errno, const char *err) err=ER(sql_errno); /* purecov: inspected */ } } + orig_err= err; } #ifdef EMBEDDED_LIBRARY @@ -123,6 +125,8 @@ void net_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; @@ -229,6 +233,8 @@ net_printf_error(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; } |