diff options
author | Alexander Barkov <bar@mariadb.org> | 2015-03-16 21:55:10 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2015-03-16 21:55:10 +0400 |
commit | e6f67c64cda4e4ca4f1463ae65f301358ed356a7 (patch) | |
tree | fe952ce152ae5383966b8761756cd59cdd86dc44 /sql/sql_parse.cc | |
parent | 4cb86b79dd61b51ab09811a8c5ef383a16638fc9 (diff) | |
download | mariadb-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.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); |