diff --git a/mysql-test/suite/sys_vars/r/innodb_encrypt_tables_basic.result b/mysql-test/suite/sys_vars/r/innodb_encrypt_tables_basic.result index bcca96b8cd7..ff48f6dfab0 100644 --- a/mysql-test/suite/sys_vars/r/innodb_encrypt_tables_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_encrypt_tables_basic.result @@ -19,17 +19,23 @@ where variable_name='innodb_encrypt_tables'; VARIABLE_NAME VARIABLE_VALUE INNODB_ENCRYPT_TABLES OFF set global innodb_encrypt_tables=ON; +ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of 'ON' +show warnings; +Level Code Message +Warning 138 InnoDB: cannot enable encryption, encryption plugin is not available +Error 1231 Variable 'innodb_encrypt_tables' can't be set to the value of 'ON' select @@global.innodb_encrypt_tables; @@global.innodb_encrypt_tables -ON +OFF set global innodb_encrypt_tables=OFF; select @@global.innodb_encrypt_tables; @@global.innodb_encrypt_tables OFF set global innodb_encrypt_tables=1; +ERROR 42000: Variable 'innodb_encrypt_tables' can't be set to the value of '1' select @@global.innodb_encrypt_tables; @@global.innodb_encrypt_tables -ON +OFF set session innodb_encrypt_tables=1; ERROR HY000: Variable 'innodb_encrypt_tables' is a GLOBAL variable and should be set with SET GLOBAL set global innodb_encrypt_tables=1.1; diff --git a/mysql-test/suite/sys_vars/t/innodb_encrypt_tables_basic.test b/mysql-test/suite/sys_vars/t/innodb_encrypt_tables_basic.test index 6d6c6b94c0f..555b67f2a28 100644 --- a/mysql-test/suite/sys_vars/t/innodb_encrypt_tables_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_encrypt_tables_basic.test @@ -19,10 +19,13 @@ where variable_name='innodb_encrypt_tables'; # # show that it's writable # +--error ER_WRONG_VALUE_FOR_VAR set global innodb_encrypt_tables=ON; +show warnings; select @@global.innodb_encrypt_tables; set global innodb_encrypt_tables=OFF; select @@global.innodb_encrypt_tables; +--error ER_WRONG_VALUE_FOR_VAR set global innodb_encrypt_tables=1; select @@global.innodb_encrypt_tables; --error ER_GLOBAL_VARIABLE diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index f1c6d03114a..fb6818a800e 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -19201,7 +19201,7 @@ static MYSQL_SYSVAR_ENUM(encrypt_tables, srv_encrypt_tables, PLUGIN_VAR_OPCMDARG, "Enable encryption for tables. " "Don't forget to enable --innodb-encrypt-log too", - NULL, + innodb_encrypt_tables_validate, innodb_encrypt_tables_update, 0, &srv_encrypt_tables_typelib); diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 99216f022fb..5a2e6b7123c 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -20383,7 +20383,7 @@ static MYSQL_SYSVAR_ENUM(encrypt_tables, srv_encrypt_tables, PLUGIN_VAR_OPCMDARG, "Enable encryption for tables. " "Don't forget to enable --innodb-encrypt-log too", - NULL, + innodb_encrypt_tables_validate, innodb_encrypt_tables_update, 0, &srv_encrypt_tables_typelib);