[MDEV-5435] cannot drop a user if its hostname part is not lowercase Created: 2013-12-12  Updated: 2014-01-23  Resolved: 2014-01-23

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.34, 10.0.6
Fix Version/s: 5.5.35, 10.0.8

Type: Bug Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
PartOf
is part of MDEV-5530 5.5.35 merge Closed

 Description   

Normally, all values in the mysql.user.host column are lowercase. The parser converts all host names to lowercase in sql_yacc.yy. But mysql_install_db does not, so if the actual local host name is not lowercase it'll end up this way in the mysql.user table.

This user entry becomes impossible to drop:

insert mysql.user (host) values ('Foo');
flush privileges;
select user,host from mysql.user;
drop user ''@Foo;
--error ER_CANNOT_USER
drop user ''@Foo;
flush privileges;
select user,host from mysql.user;
drop user ''@foo;
flush privileges;
select user,host from mysql.user;

Note flush privileges after every drop user. Because the user is actually deleted from the in-memory structures, but not from the table on disk. That's why the second drop user fails, but if we re-read privilege tables, it reappears.



 Comments   
Comment by Sergei Golubchik [ 2014-01-23 ]

fixed in MDEV-5530, MySQL Bug #12917164

Generated at Thu Feb 08 07:04:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.