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:
@ -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);
|
||||
|
Reference in New Issue
Block a user