summaryrefslogtreecommitdiff
path: root/libmysqld/lib_sql.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libmysqld/lib_sql.cc')
-rw-r--r--libmysqld/lib_sql.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index f01a6b3f3df..b49e220d821 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -1087,6 +1087,9 @@ net_send_eof(THD *thd, uint server_status, uint statement_warn_count)
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;
MYSQL_DATA *data= thd->cur_data;
struct embedded_query_result *ei;
@@ -1101,7 +1104,12 @@ bool net_send_error_packet(THD *thd, uint sql_errno, const char *err,
ei= data->embedded_info;
ei->last_errno= sql_errno;
- strmake(ei->info, err, sizeof(ei->info)-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);
+ strmake(ei->info, (const char*) converted_err, sizeof(ei->info)-1);
strmov(ei->sqlstate, sqlstate);
ei->server_status= thd->server_status;
thd->cur_data= 0;