[Commits] 5b59c7a861a: After review changes.
revision-id: 5b59c7a861ab0f2962057c5d9da418e1a2f9002f (mariadb-10.1.37-7-g5b59c7a861a) parent(s): 0981a7661b7e34437aff8750ab19b926e573b877 author: Jan Lindström committer: Jan Lindström timestamp: 2018-11-06 10:19:16 +0200 message: After review changes. --- mysql-test/suite/encryption/r/innodb-encryption-alter.result | 6 +++--- storage/innobase/handler/ha_innodb.cc | 10 +++++----- storage/xtradb/handler/ha_innodb.cc | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/mysql-test/suite/encryption/r/innodb-encryption-alter.result b/mysql-test/suite/encryption/r/innodb-encryption-alter.result index 75417074fb0..5245d1da7d0 100644 --- a/mysql-test/suite/encryption/r/innodb-encryption-alter.result +++ b/mysql-test/suite/encryption/r/innodb-encryption-alter.result @@ -56,7 +56,7 @@ ALTER TABLE t1 ENCRYPTION_KEY_ID=4; ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID' SHOW WARNINGS; Level Code Message -Warning 140 InnoDB: Incorrect ENCRYPTION_KEY_ID 4 when encryption is disabled +Warning 140 InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1 Error 1478 Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID' SHOW CREATE TABLE t1; Table Create Table @@ -70,7 +70,7 @@ ALTER TABLE t2 ENCRYPTION_KEY_ID=4, ALGORITHM=COPY; ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message -Warning 140 InnoDB: Incorrect ENCRYPTION_KEY_ID 4 when encryption is disabled +Warning 140 InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1 Error 1005 Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options") Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB SHOW CREATE TABLE t2; @@ -84,6 +84,6 @@ CREATE TABLE t3 (a int not null primary key) engine=innodb ENCRYPTION_KEY_ID=4; ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options") SHOW WARNINGS; Level Code Message -Warning 140 InnoDB: Incorrect ENCRYPTION_KEY_ID 4 when encryption is disabled +Warning 140 InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1 Error 1005 Can't create table `test`.`t3` (errno: 140 "Wrong create options") Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index d0d7f2374ba..b3a830e47c3 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -11960,14 +11960,14 @@ ha_innobase::check_table_options( /* If default encryption is used and encryption is disabled, you may not use nondefault encryption_key_id as it is not stored anywhere. */ - if (encrypt == FIL_ENCRYPTION_DEFAULT && - !srv_encrypt_tables && - options->encryption_key_id != FIL_DEFAULT_ENCRYPTION_KEY) { + if (encrypt == FIL_ENCRYPTION_DEFAULT + && !srv_encrypt_tables + && options->encryption_key_id != FIL_DEFAULT_ENCRYPTION_KEY) { + compile_time_assert(FIL_DEFAULT_ENCRYPTION_KEY == 1); push_warning_printf( thd, Sql_condition::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, - "InnoDB: Incorrect ENCRYPTION_KEY_ID %u when encryption is disabled", - (uint)options->encryption_key_id + "InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1" ); return "ENCRYPTION_KEY_ID"; } diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index c7eb4d28844..05066512db9 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -12527,14 +12527,14 @@ ha_innobase::check_table_options( /* If default encryption is used and encryption is disabled, you may not use nondefault encryption_key_id as it is not stored anywhere. */ - if (encrypt == FIL_ENCRYPTION_DEFAULT && - !srv_encrypt_tables && - options->encryption_key_id != FIL_DEFAULT_ENCRYPTION_KEY) { + if (encrypt == FIL_ENCRYPTION_DEFAULT + && !srv_encrypt_tables + && options->encryption_key_id != FIL_DEFAULT_ENCRYPTION_KEY) { + compile_time_assert(FIL_DEFAULT_ENCRYPTION_KEY == 1); push_warning_printf( thd, Sql_condition::WARN_LEVEL_WARN, HA_WRONG_CREATE_OPTION, - "InnoDB: Incorrect ENCRYPTION_KEY_ID %u when encryption is disabled", - (uint)options->encryption_key_id + "InnoDB: innodb_encrypt_tables=OFF only allows ENCRYPTION_KEY_ID=1" ); return "ENCRYPTION_KEY_ID"; }
participants (1)
-
jan