Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
13.0
-
None
Description
An engine-defined table option that the storage engine doesn't know fails with error 1911 when it is set for the whole table. The same option set for a single partition is silently discarded: no error, no warning (not even in strict mode), and it isn't in SHOW CREATE TABLE. A typo in a per-partition option, such as PAGE_COMPRESED, therefore goes unnoticed, and the partition is created without the intended setting.
--source include/have_innodb.inc
|
--source include/have_partition.inc
|
|
|
# Table level: error, as expected |
--error ER_UNKNOWN_OPTION
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB PAGE_COMPRESED=1; |
|
|
# Partition level: accepted, no warning, option gone |
CREATE TABLE t (a INT) ENGINE=InnoDB |
PARTITION BY HASH (a) (PARTITION p0 PAGE_COMPRESED=1, PARTITION p1); |
SHOW WARNINGS;
|
SHOW CREATE TABLE t; |
DROP TABLE t; |
Result on 13.0.2 with the default sql_mode (STRICT_TRANS_TABLES,...):
CREATE TABLE t1 (a INT) ENGINE=InnoDB PAGE_COMPRESED=1;
|
ERROR 1911 (HY000): Unknown option 'PAGE_COMPRESED'
|
|
|
CREATE TABLE t (...) PARTITION BY HASH (a) (PARTITION p0 PAGE_COMPRESED=1, PARTITION p1);
|
-- succeeds, SHOW WARNINGS is empty
|
SHOW CREATE TABLE t:
|
PARTITION BY HASH (`a`)
|
(PARTITION `p0` ENGINE = InnoDB,
|
PARTITION `p1` ENGINE = InnoDB)
|
With IGNORE_BAD_TABLE_OPTIONS added to sql_mode, the option is kept (PARTITION p0 ENGINE = InnoDB `PAGE_COMPRESED`='1'), so only the default (error) path is affected.
Expected: the same as at table level: ER_UNKNOWN_OPTION unless IGNORE_BAD_TABLE_OPTIONS is set.
Possibly relevant: for the whole table, mysql_prepare_create_table() in sql/sql_table.cc calls parse_option_list(..., suppress_warning=FALSE, ...). For partitions, parse_engine_part_options() in sql/create_options.cc calls parse_option_list(..., TRUE, ...). Whether that explains the drop from the .frm too, I haven't confirmed.
Reproduced on 13.0.2; likely affects every version since 10.8.1 (per-partition engine options, MDEV-5271), but only 13.0 was tested.
Found while documenting per-partition options (MDEV-27564). The docs describe this behavior as is ("ignored without an error or warning") and will be updated when this is fixed.
Attachments
Issue Links
- relates to
-
MDEV-5271 Support engine-defined attributes per partition
-
- Closed
-
-
MDEV-27564 Clearly specify/indicate in the partitioning manual which per-partition options are available
-
- Confirmed
-
-
MDEV-37815 refactor engine attributes in partitioning
-
- Closed
-