Bug #35340 show create table and information_schema TABLES.ROW_FORMAT contradiction
Submitted: 17 Mar 2008 14:24 Modified: 24 Mar 2008 15:50
Reporter: Roland Bouman Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Information schema Severity:S3 (Non-critical)
Version:5.1.23, 5.0, 5.1, 6.0 BK OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Triage: D4 (Minor)

[17 Mar 2008 14:24] Roland Bouman
Description:
The SHOW CREATE TABLE statement and the information_schema.TABLES table offer contradicting information about the ROW_FORMAT used by a MyISAM table.

The information-schema seems to give the actual format whereas SHOW CREATE TABLE returns the last explicitly specified row format (set using a ROW_FORMAT table option in ALTER TABLE or CREATE TABLE)

How to repeat:
mysql> show create table row_format;
+------------+-------------------------------------------------------------------------------------------------------------------------------+
| Table      | Create Table                                                                                                                  |
+------------+-------------------------------------------------------------------------------------------------------------------------------+
| row_format | CREATE TABLE "row_format" (
  "id" int(11) DEFAULT NULL,
  "c" text
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC |
+------------+-------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select row_format from information_schema.tables where table_name = 'row_format';
+------------+
| row_format |
+------------+
| Dynamic    |
+------------+
1 row in set, 19 warnings (0.00 sec)

mysql> alter table row_format row_format fixed;
Query OK, 0 rows affected, 1 warning (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> select row_format from information_schema.tables where table_name = 'row_format';
+------------+
| row_format |
+------------+
| Dynamic    |
+------------+
1 row in set, 19 warnings (0.00 sec)

mysql> show create table row_format;
+------------+-----------------------------------------------------------------------------------------------------------------------------+
| Table      | Create Table                                                                                                                |
+------------+-----------------------------------------------------------------------------------------------------------------------------+
| row_format | CREATE TABLE "row_format" (
  "id" int(11) DEFAULT NULL,
  "c" text
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED |
+------------+-----------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> alter table row_format row_format compressed;
Query OK, 0 rows affected, 1 warning (0.01 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> show create table row_format;
+------------+----------------------------------------------------------------------------------------------------------------------------------+
| Table      | Create Table                                                                                                                     |
+------------+----------------------------------------------------------------------------------------------------------------------------------+
| row_format | CREATE TABLE "row_format" (
  "id" int(11) DEFAULT NULL,
  "c" text
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED |
+------------+----------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select row_format from information_schema.tables where table_name = 'row_format';
+------------+
| row_format |
+------------+
| Dynamic    |
+------------+
1 row in set, 19 warnings (0.00 sec)

Suggested fix:
Make them reflect the same info or fix the documentation to explain this
[17 Mar 2008 15:39] Sveta Smirnova
Thank you for the report.

Verified as described.
[24 Mar 2008 15:50] Sergei Golubchik
duplicate of Bug#22632