Bug #31381 Error in retrieving Data from INFORMATION_SCHEMA
Submitted: 3 Oct 2007 17:17 Modified: 30 Oct 2007 23:55
Reporter: Jens Greven Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.22\5.1BK OS:Windows (Linux)
Assigned to: Sergei Glukhov CPU Architecture:Any
Tags: collation

[3 Oct 2007 17:17] Jens Greven
Description:
"SELECT * FROM INFORMATION_SCHEMA.TABLES;"
does retrieve the expected data including the TABLE_COLLATION. 

"SELECT TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES;"
does unexpectedly not show the TABLE_COLLATION for all tables except those from INFORMATION_SCHEMA.

How to repeat:
can be repeated using the above statements
[3 Oct 2007 20:46] MySQL Verification Team
Thank you for the bug report.

    UPDATE_TIME: 2007-10-03 17:30:52
     CHECK_TIME: NULL
TABLE_COLLATION: utf8_general_ci
       CHECKSUM: NULL
 CREATE_OPTIONS:
  TABLE_COMMENT: Time zone transition types
*************************** 50. row ***************************
  TABLE_CATALOG: NULL
   TABLE_SCHEMA: mysql
     TABLE_NAME: user
     TABLE_TYPE: BASE TABLE
         ENGINE: MyISAM
        VERSION: 10
     ROW_FORMAT: Dynamic
     TABLE_ROWS: 3
 AVG_ROW_LENGTH: 50
    DATA_LENGTH: 152
MAX_DATA_LENGTH: 281474976710655
   INDEX_LENGTH: 2048
      DATA_FREE: 0
 AUTO_INCREMENT: NULL
    CREATE_TIME: 2007-10-03 17:30:51
    UPDATE_TIME: 2007-10-03 17:30:53
     CHECK_TIME: NULL
TABLE_COLLATION: utf8_bin
       CHECKSUM: NULL
 CREATE_OPTIONS:
  TABLE_COMMENT: Users and global privileges
50 rows in set (0.04 sec)

mysql> SELECT TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES;
+-----------------+
| TABLE_COLLATION |
+-----------------+
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
| utf8_general_ci |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
+-----------------+
50 rows in set (0.04 sec)

mysql> show variables like "%version%"
    -> ;
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| protocol_version        | 10                  |
| version                 | 5.1.23-beta-debug   |
| version_comment         | Source distribution |
| version_compile_machine | x86_64              |
| version_compile_os      | suse-linux-gnu      |
+-------------------------+---------------------+
5 rows in set (0.01 sec)

mysql>
[16 Oct 2007 11:07] 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/35635

ChangeSet@1.2574, 2007-10-16 16:02:54+05:00, gluh@mysql.com +3 -0
  Bug#31381 Error in retrieving Data from INFORMATION_SCHEMA
  move 'table_collation' field filling outside of if(file) condition
  beacuse this field has 'OPEN_FRM_ONLY' attribute
[16 Oct 2007 11:21] Sergey Vojtovich
Ok to push.
[17 Oct 2007 9:12] 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/35739

ChangeSet@1.2586, 2007-10-17 14:08:03+05:00, gluh@mysql.com +3 -0
  Bug#31381 Error in retrieving Data from INFORMATION_SCHEMA
  move 'table_collation' field filling outside of if(file) condition
  because this field has 'OPEN_FRM_ONLY' attribute
[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
[30 Oct 2007 23:55] Paul DuBois
Noted in 5.1.23, 6.0.4 changelogs.

INFORMATION_SCHEMA.TABLES was returning incorrect information.