Bug #21546 Username silently truncated by CREATE USER, next call gives fuzzy error message
Submitted: 9 Aug 2006 17:17 Modified: 22 Sep 2006 9:35
Reporter: Andrey Hristov Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0 OS:Any (All)
Assigned to: Sergei Glukhov CPU Architecture:Any

[9 Aug 2006 17:17] Andrey Hristov
Description:
There is a restriction of the length of the user name. However, CREATE USER does not give an error back when it's too long, or even a warning. The truncated user name is written on disk.
Next call gives an error, but actually the error is too fuzzy. It should say that there is already an user with the same name@host, and not "operation failed".
GRANT works ok and gives an error back that the user part is too long.

mysql> create user andrey_jordanov_hristov@localhost;
Query OK, 0 rows affected (0.05 sec)

mysql> create user andrey_jordanov_hristov@localhost;
ERROR 1396 (HY000): Operation CREATE USER failed for 'andrey_jordanov_hristov'@'localhost'
mysql> grant all on *.* to andrey_jordanov_hristov@localhost;
ERROR 1145 (42000): The host or user argument to GRANT is too long

How to repeat:
create user andrey_jordanov_hristov@localhost;
create user andrey_jordanov_hristov@localhost;
grant all on *.* to andrey_jordanov_hristov@localhost;
[22 Sep 2006 9:35] Sergei Glukhov
Can't repeat on latest tree, fixed by fix for Bug#20393 "User name truncation in mysql client"