Bug #30795 Query on INFORMATION_SCHEMA.SCHEMATA, wrong result
Submitted: 4 Sep 2007 14:08 Modified: 1 Nov 2007 2:56
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Information schema Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Sergei Glukhov CPU Architecture:Any

[4 Sep 2007 14:08] Matthias Leich
Description:
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA;
SCHEMA_NAME
information_schema
mysql
test
--> There exists the schema 'information_schema'.
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME ='information_schema';
SCHEMA_NAME
--> Why do I get here an empty result set?
SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA
WHERE SCHEMA_NAME LIKE 'information_schema%';
SCHEMA_NAME
information_schema
--> Surprise, LIKE helps
SELECT DISTINCT(TABLE_SCHEMA) FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'information_schema';
TABLE_SCHEMA
information_schema
--> So it is most probably some bad property of the table
    INFORMATION_SCHEMA.SCHEMATA. 

My environment:
- Linux OpenSuSE 10.2 64 Bit, Intel Core2Duo (64 Bit)
- MySQL compiled from source with 
  compile-pentium-debug-max
- mysql-5.1-rpl last ChangeSet@1.2566.1.1, 2007-08-29
  This source tree contains
     ChangeSet@1.2547.4.7 which fixes
  Bug#30310 wrong result on SELECT * FROM 
            INFORMATION_SCHEMA.SCHEMATA WHERE ..

How to repeat:
Please use the statements above or the attached test
script ml21.test.
1. Copy it to mysql-test/t
2. echo "Dummy" > r/ml21.result
   # Produce a dummy file with expected results.
3. ./mysql-test-run.pl ml21
4. Inspect r/ml21.reject
[4 Sep 2007 14:09] Matthias Leich
test script

Attachment: ml021.test (application/octet-stream, text), 418 bytes.

[17 Sep 2007 9:29] Bugs System
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/34337

ChangeSet@1.2556, 2007-09-17 14:24:59+05:00, gluh@mysql.com +3 -0
  Bug#30795 Query on INFORMATION_SCHEMA.SCHEMATA, wrong result
  skip the check of directory presence for 'information_schema' name
[28 Sep 2007 12:38] Bugs System
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/34637

ChangeSet@1.2574, 2007-09-28 17:33:30+05:00, gluh@mysql.com +3 -0
  Bug#30795 Query on INFORMATION_SCHEMA.SCHEMATA, wrong result
  skip the check of directory presence for 'information_schema' name
[29 Oct 2007 8:47] Bugs System
Pushed into 5.1.23-beta
[29 Oct 2007 8:50] Bugs System
Pushed into 6.0.4-alpha
[1 Nov 2007 2:56] Paul DuBois
Noted in 5.1.23, 6.0.4 changelogs.

INFORMATION_SCHEMA.SCHEMATA was returning incorrect information.