summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-03-16 21:55:10 +0400
committerAlexander Barkov <bar@mariadb.org>2015-03-16 21:55:10 +0400
commite6f67c64cda4e4ca4f1463ae65f301358ed356a7 (patch)
treefe952ce152ae5383966b8761756cd59cdd86dc44 /sql/sql_parse.cc
parent4cb86b79dd61b51ab09811a8c5ef383a16638fc9 (diff)
downloadmariadb-git-e6f67c64cda4e4ca4f1463ae65f301358ed356a7.tar.gz
MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc5
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);