[MDEV-15116] Wrong error code/message 1478: 'Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID' Created: 2018-01-29  Updated: 2022-02-21

Status: Open
Project: MariaDB Server
Component/s: Encryption, Storage Engine - InnoDB
Affects Version/s: 10.1, 10.1.29, 10.2
Fix Version/s: 10.2

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Vladislav Lesin
Resolution: Unresolved Votes: 1
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-14219 Allow online table rebuild when encry... Closed
Relates
relates to MDEV-12884 Bad error message upon ALTER TABLE wi... Open

 Description   

ALTER in following test case produces an unexpected error message/code:

--source include/have_innodb.inc
--source suite/encryption/include/have_file_key_management_plugin.inc
 
CREATE TABLE t1 (i INT) ENGINE=InnoDB ENCRYPTED=YES;
# Here should be --error <error code>
ALTER TABLE t1 ENCRYPTION_KEY_ID = 9;
 
# Cleanup
DROP TABLE t1;

mysqltest: At line 5: query 'ALTER TABLE t1 ENCRYPTION_KEY_ID = 9' failed: 1478: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'

The change was introduced in 10.1.29 by this commit:

commit 88edb1b3edcea0dad82659ca6622448e535a3fa6
Author: Marko Mäkelä <marko.makela@mariadb.com>
Date:   Mon Oct 30 18:47:43 2017 +0200
 
    MDEV-14219 Allow online table rebuild when encryption or compression parameters change

Judging by test result modifications in the commit, it was intentional. However, it is really wrong and misleading, the table option is obviously supported, it's just the key value that's wrong.



 Comments   
Comment by Marko Mäkelä [ 2021-04-26 ]

serg, how could this be fixed? I seem to remember that you are reluctant to add storage engine specific error messages.

Comment by Sergei Golubchik [ 2021-04-28 ]

Yes, to the server-wide errmsg-utf8.txt file.

But InnoDB does that in many places, and it's quite fine:

push_warning(
	m_thd, Sql_condition::WARN_LEVEL_WARN,
	ER_ILLEGAL_HA_CREATE_OPTION,
	"InnoDB: DATA DIRECTORY requires"
	" innodb_file_per_table.");

I cannot say if it's applicable to this particular case as I cannot understand from the commit 88edb1b3edc, how it had caused ER_ILLEGAL_HA_CREATE_OPTION to appear.

Comment by Marko Mäkelä [ 2021-09-28 ]

It looks like the easiest fix of this would be to allow create_table_info_t::create_options_are_invalid() and create_table_info_t::check_table_options() construct a complete string, such as ENCRYPTION_KEY_ID=9, possibly in a fixed-length data member of create_table_info_t. We also claim that ROW_FORMAT is not supported, when referring to specific ROW_FORMAT values under certain circumstances.

Generated at Thu Feb 08 08:18:48 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.