Bug #83647 ROW_FORMAT= Dynamic can be set with innodb_file_format= Antelope
Submitted: 2 Nov 2016 9:33 Modified: 8 Nov 2016 20:11
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.7.16 OS:CentOS (7.2)
Assigned to: CPU Architecture:Any

[2 Nov 2016 9:33] Tsubasa Tanaka
Description:
Before 5.7, table cannot be created Dynamic row-format with innodb_file_format= Antelope (Returns warning and table is created as Compact row-format)

5.7 can create Dynamic row-format table even innodb_file_format= Antelope, without any warnings and actually SHOW TABLE STATUS returns Row_format= Dynamic.

5.7's code checks innodb_file_format only when ROW_FORMAT= Compressed.

https://github.com/mysql/mysql-server/blob/mysql-5.7.16/storage/innobase/handler/ha_innodb...

5.6's one checks both when ROW_FORMAT= Compressed and ROW_FORMAT= Dynamic.

https://github.com/mysql/mysql-server/blob/mysql-5.6.34/storage/innobase/handler/ha_innodb...

Is this expected behavior?

> The Barracuda file format is required to use Compressed or Dynamic row formats and associated features such as compression,

http://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_file_format

If this (Can use ROW_FORMAT= Dynamic even with innodb_file_format=Antelope) is expected, 
please change category to "MySQL Server: Documentation" (Fix to "Be required to use Compressed but Dynamic doesn't require now")

How to repeat:
[5.6.34]
$ bin/mysqld_safe --no-defaults --innodb-file-format=antelope --innodb-file-format-max=antelope &

mysql> CREATE TABLE t1 (num int) Engine= InnoDB ROW_FORMAT= Dynamic;
Query OK, 0 rows affected, 2 warnings (0.01 sec)

mysql> SHOW WARNINGS;
+---------+------+--------------------------------------------------------------------+
| Level   | Code | Message                                                            |
+---------+------+--------------------------------------------------------------------+
| Warning | 1478 | InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope. |
| Warning | 1478 | InnoDB: assuming ROW_FORMAT=COMPACT.                               |
+---------+------+--------------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> SHOW GLOBAL VARIABLES LIKE 'innodb\_file\_format%';
+--------------------------+-----------+
| Variable_name            | Value     |
+--------------------------+-----------+
| innodb_file_format       | Antelope  |
| innodb_file_format_check | ON        |
| innodb_file_format_max   | Barracuda |
+--------------------------+-----------+
3 rows in set (0.00 sec)

mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `num` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC
1 row in set (0.00 sec)

mysql> SHOW TABLE STATUS LIKE 't1'\G
*************************** 1. row ***************************
           Name: t1
         Engine: InnoDB
        Version: 10
     Row_format: Compact
           Rows: 0
 Avg_row_length: 0
    Data_length: 16384
Max_data_length: 0
   Index_length: 0
      Data_free: 0
 Auto_increment: NULL
    Create_time: 2016-11-02 18:16:54
    Update_time: NULL
     Check_time: NULL
      Collation: utf8mb4_general_ci
       Checksum: NULL
 Create_options: row_format=DYNAMIC
        Comment:
1 row in set (0.00 sec)

[5.7.16]

$ bin/mysqld_safe --no-defaults --innodb-file-format=antelope --innodb-file-format-max=antelope &

mysql> SHOW GLOBAL VARIABLES LIKE 'innodb\_file\_format%';
+--------------------------+-----------+
| Variable_name            | Value     |
+--------------------------+-----------+
| innodb_file_format       | Antelope  |
| innodb_file_format_check | ON        |
| innodb_file_format_max   | Barracuda |
+--------------------------+-----------+
3 rows in set (0.00 sec)

mysql> CREATE TABLE t1 (num int) Engine= InnoDB ROW_FORMAT= Dynamic;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `num` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC
1 row in set (0.00 sec)

mysql> SHOW TABLE STATUS LIKE 't1'\G
*************************** 1. row ***************************
           Name: t1
         Engine: InnoDB
        Version: 10
     Row_format: Dynamic
           Rows: 0
 Avg_row_length: 0
    Data_length: 16384
Max_data_length: 0
   Index_length: 0
      Data_free: 0
 Auto_increment: NULL
    Create_time: 2016-11-02 18:14:43
    Update_time: NULL
     Check_time: NULL
      Collation: utf8mb4_general_ci
       Checksum: NULL
 Create_options: row_format=DYNAMIC
        Comment:
1 row in set (0.00 sec)

Suggested fix:
See Description.
[2 Nov 2016 11:19] MySQL Verification Team
Hello Tanaka-San,

Thank you for the report and test case.
Verified as described.

Thanks,
Umesh
[8 Nov 2016 20:11] Daniel Price
Posted by developer:
 
As of MySQL 5.7.9, the innodb_file_format setting is ignored when
creating tables that use the DYNAMIC row format. A table created using the
DYNAMIC row format always uses the Barracuda file format, regardless of
the innodb_file_format setting. To use the COMPRESSED row format,
innodb_file_format must be set to Barracuda. 

The innodb_file_format setting description has been updated. The change should appear online soon.
http://furl.oraclecorp.com/kqgR

Thank you for the bug report.