Bug #10384 Create user accepts extended characters in user name.
Submitted: 5 May 2005 12:41 Modified: 13 Jul 2005 9:48
Reporter: Disha Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.0.7 Beta OS:Windows (Windows 2003)
Assigned to: Alexander Barkov CPU Architecture:Any

[5 May 2005 12:41] Disha
Description:
If we try to create a user with user name containing extended characters then no error is displayed and the user is created. But the user fails to login using the command line client.

How to repeat:
1. Start the MySQL client and connect to the database with valid user and password.
2. Set the delimiter to //
3. Create a user with user name containing extended character (can be achieved as ALT + 1185 key combination):

   create user <Name containing extended characters> identified as test

4. Once the user is created open another command line client and try to login with that user.
5. When asked for the password, enter the password.

Expected Results: 
1. The user should be able to login from the command line client.

Actual Results: 
1. The user cannot login from the command line client.
[28 Jun 2005 10:27] Alexander Barkov
I cannot reproduce this problem.
Can you please try the following:
1. before creating the user, run:
SHOW VARIABLES LIKE 'character_set%';

2. After creating the user, run:
SELECT HEX(User),User, Host FROM mysql.User;

Thanks!
[28 Jun 2005 10:31] Alexander Barkov
Also, please, before creating the user, please try:

SELECT HEX('User');

Where 'User' is a user name you're creating,
i.e. a name containing a special character.
Thanks!
[12 Jul 2005 7:06] Disha
I have tried to create user using extended characters, appropriate error message is displayed. I checked it on version 5.0.7 beta-nt.

create user abcíídef identified by 'test'//

It displays the following error message,

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'íídef identified by 'test'' at line 1
[13 Jul 2005 8:33] Alexander Barkov
So, there is no problem anymore, right?

Anyway, what do these query return for you?

SHOW VARIABLES LIKE 'character_set%';
SELECT HEX('abcíídef');

Thanks!
[13 Jul 2005 9:27] Disha
Yes, there is no problem.
The following queries are executed,
      SHOW VARIABLES LIKE 'character_set%'//
The result of above query is displayed as follows,
+--------------------------+-----------------------------+
| Variable_name            | Value                       |
+--------------------------+-----------------------------+
| character_set_client     | latin1                      |
| character_set_connection | latin1                      |
| character_set_database   | latin1                      |
| character_set_results    | latin1                      |
| character_set_server     | latin1                      |
| character_set_system     | utf8                        |
| character_sets_dir       | C:\mysql507\share\charsets/ |
+--------------------------+-----------------------------+

And the query,
       SELECT HEX('abcíídef')//
The result of above query is displayed as follows,

+------------------+
| HEX('abcíídef')  |
+------------------+
| 616263A1A1646566 |
+------------------+
Thanks,
[13 Jul 2005 9:48] Alexander Barkov
Thanks for your feedback!
Note, according to hex output, I conclude that
you execute it from "mysql.exe" rather than
from some GUI tool.

Note, that mysql.exe is a DOS-alike console
application. It means it uses cp850 character set,
not latin1.

You need to start "mysql.exe --default-character-set=cp850".
Or you can add this setting into my.cnf not to type it each time.

Otherwise, accented letters will be typed in cp850 but treated as latin1,
which will give wrong result.

I'm closing this report as "not a bug".