diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-11-03 19:17:05 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-11-03 19:17:05 +0100 |
commit | 0e007344eae972b9be7d88ca43373cb33662ac1c (patch) | |
tree | 7b3561cb3ea2ad24d013e847680ec165f406387e /libmysqld/lib_sql.cc | |
parent | 3794110f0215f0631107c2694dc0f1675a4bb520 (diff) | |
parent | 681476255147dacac7e3674b6cd2ae770fee2208 (diff) | |
download | mariadb-git-0e007344eae972b9be7d88ca43373cb33662ac1c.tar.gz |
mysql-5.5.18 merge
Diffstat (limited to 'libmysqld/lib_sql.cc')
-rw-r--r-- | libmysqld/lib_sql.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index f35e3cc9552..1ba54350883 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -1149,8 +1149,7 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err, const char *sqlstate) { uint error; - uchar converted_err[MYSQL_ERRMSG_SIZE]; - uint32 converted_err_len; + char converted_err[MYSQL_ERRMSG_SIZE]; MYSQL_DATA *data= thd->cur_data; struct embedded_query_result *ei; @@ -1165,12 +1164,12 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err, ei= data->embedded_info; ei->last_errno= sql_errno; - converted_err_len= convert_error_message((char*)converted_err, - sizeof(converted_err), - thd->variables.character_set_results, - err, strlen(err), - system_charset_info, &error); - strmake(ei->info, (const char*) converted_err, sizeof(ei->info)-1); + convert_error_message(converted_err, sizeof(converted_err), + thd->variables.character_set_results, + err, strlen(err), + system_charset_info, &error); + /* Converted error message is always null-terminated. */ + strmake(ei->info, converted_err, sizeof(ei->info)-1); strmov(ei->sqlstate, sqlstate); ei->server_status= thd->server_status; thd->cur_data= 0; |