Bug #3403 Wrong encoding in SHOW GRANTS, EPLAIN SELECT output
Submitted: 6 Apr 2004 16:25 Modified: 14 May 2004 10:31
Reporter: Alexander Kirillov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1, 5.0 OS:FreeBSD (FreeBSD)
Assigned to: Alexander Barkov CPU Architecture:Any

[6 Apr 2004 16:25] Alexander Kirillov
Description:
SHOW GRANTS, EXPLAIN SELECT (and probably some other informational) queries
return database/table names in wrong encoding (probably UTF-8) if database/table names
include national characters. In my case koi8r.
This is serious as my app needs to parse SHOW GRANTS output.

How to repeat:
my.cnf
...
[mysqld]
language=russian
default-character-set=koi8r
...
CREATE DATABASE `koi8r name`;
GRANT SELECT ON `koi8r name`.* TO `some valid user`@`localhost`;
FLUSH PRIVILEGES;
SHOW GRANTS FOR `same user`@`localhost`;
Database name shows up as ???????
...
CREATE TABLE `some database`.`koi8r name` (id int) TYPE=MyISAM;
INSERT INTO `some database`.`koi8r name` SET `id`='1';
EXPLAIN SELECT * FROM `some database`.`koi8r name` LIMIT 5;
Table name shows up as ????
[14 May 2004 9:51] Alexander Barkov
GRANT related fix has been applied to 4.1.2 sources.
EXPLAIN will be fixed in a separate changeset.
[14 May 2004 10:31] Alexander Barkov
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html