diff options
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 640eee093cc..3109b2ffe86 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1320,8 +1320,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, { LEX_STRING tmp; status_var_increment(thd->status_var.com_stat[SQLCOM_CHANGE_DB]); - thd->convert_string(&tmp, system_charset_info, - packet, packet_length, thd->charset()); + if (thd->copy_with_error(system_charset_info, &tmp, + thd->charset(), packet, packet_length)) + break; if (!mysql_change_db(thd, &tmp, FALSE)) { general_log_write(thd, command, thd->db, thd->db_length); |