Bug #20393 User name truncation in mysql client
Submitted: 12 Jun 2006 13:10 Modified: 19 Sep 2006 16:43
Reporter: Peter Gulutzan Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.1.12-beta-debug OS:Linux (SUSE 10.0)
Assigned to: Sergey Glukhov CPU Architecture:Any

[12 Jun 2006 13:10] Peter Gulutzan
Description:
In mysql.user, I see that the maximum length of a user name
is 16 (utf8) characters, not 16 bytes. In the MySQL Reference
Manual (8.6.1. mysql Options), I see no suggestion that there
is a requirement for non-UTF8 command-line input. But when
I use --user=username and username contains multi-byte
characters, and username octet length is greater than 16
but username character length is less than 16, I see truncation.

How to repeat:
pgulutzan@linux:~> /usr/local/mysql/bin/mysql --default-character-set=utf8 --user=ペテルグルツン
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 5.1.12-beta-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select user();
+---------------------------+
| user()                    |
+---------------------------+
| ペテルグル@localhost      |
+---------------------------+
1 row in set (0.00 sec)
[14 Jun 2006 6:58] Hartmut Holzgraefe
$ mysql --default-character-set=utf8 --user=aaaaoooouuuu -e "select user()\G"
*************************** 1. row ***************************
user(): aaaaoooouuuu@localhost

$ mysql --default-character-set=utf8 --user=ääääööööüüüü -e "select user()\G"
*************************** 1. row ***************************
user(): ääääöööö@localhost
[15 Aug 2006 10:20] Sergey Glukhov
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/10446

ChangeSet@1.2226, 2006-08-15 15:34:41+05:00, gluh@mysql.com +7 -0
  Bug#20393 User name truncation in mysql client
  Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte
[23 Aug 2006 10:39] Sergey Glukhov
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/10752

ChangeSet@1.2544, 2006-08-23 15:54:40+05:00, gluh@mysql.com +7 -0
  Bug#20393 User name truncation in mysql client
  Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with
multi-byte
[30 Aug 2006 11:06] Sergey Glukhov
Fixed in 4.1.22
[12 Sep 2006 1:16] Paul Dubois
Noted in 4.1.22 changelog.

Usernames have a maximum length of 16 characters (even if they
contain multi-byte characters), but were being truncated to 16 bytes.
[18 Sep 2006 21:57] Timothy Smith
Pushed to 5.0.26 and 5.1.12
[19 Sep 2006 16:43] Paul Dubois
Noted in 5.0.26, 5.1.12 changelogs.