1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-6572 "USE dbname" with a bad sequence erroneously connects to a wrong database

This commit is contained in:
Alexander Barkov
2015-03-16 21:55:10 +04:00
parent 4cb86b79dd
commit e6f67c64cd
13 changed files with 232 additions and 21 deletions

View File

@ -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);