diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-10-23 15:22:21 +0400 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-10-23 15:22:21 +0400 |
commit | 069d78c06714233dcdc6011fa3262a54df6a1ed4 (patch) | |
tree | 9a94748e3f29d58645ae7979faaf09464080033d /sql/protocol.cc | |
parent | 40c0ae812965d86406f8e44fc0c4af0914858d46 (diff) | |
parent | 2f5413ebc5a47ed45abe0d3c660cfbf673c666e2 (diff) | |
download | mariadb-git-069d78c06714233dcdc6011fa3262a54df6a1ed4.tar.gz |
Merge from mysql-next-mr.
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r-- | sql/protocol.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc index 68e22564952..5990f0f001a 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -381,6 +381,9 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err, /* buff[]: sql_errno:2 + ('#':1 + SQLSTATE_LENGTH:5) + MYSQL_ERRMSG_SIZE:512 */ + uint error; + uchar converted_err[MYSQL_ERRMSG_SIZE]; + uint32 converted_err_len; uchar buff[2+1+SQLSTATE_LENGTH+MYSQL_ERRMSG_SIZE], *pos; DBUG_ENTER("send_error_packet"); @@ -403,7 +406,12 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err, buff[2]= '#'; pos= (uchar*) strmov((char*) buff+3, sqlstate); } - length= (uint) (strmake((char*) pos, err, MYSQL_ERRMSG_SIZE-1) - + converted_err_len= convert_error_message((char*)converted_err, + sizeof(converted_err), + thd->variables.character_set_results, + err, strlen(err), + system_charset_info, &error); + length= (uint) (strmake((char*) pos, (char*)converted_err, MYSQL_ERRMSG_SIZE) - (char*) buff); err= (char*) buff; DBUG_RETURN(net_write_command(net,(uchar) 255, (uchar*) "", 0, (uchar*) err, |