Browse Source
s/innodb_default_encryption_key/innodb_default_encryption_key_id/
s/innodb_default_encryption_key/innodb_default_encryption_key_id/
and make it a session variable, not global, as any decent default sysvar for a table attribute should bepull/42/head
12 changed files with 14 additions and 164 deletions
-
2mysql-test/suite/innodb/r/innodb-page_encryption.result
-
4mysql-test/suite/innodb/t/innodb-page_encryption.test
-
2mysql-test/suite/sys_vars/r/all_vars.result
-
71mysql-test/suite/sys_vars/r/innodb_default_page_encryption_key_basic.result
-
6mysql-test/suite/sys_vars/r/sysvars_innodb.result
-
60mysql-test/suite/sys_vars/t/innodb_default_page_encryption_key_basic.test
-
11storage/innobase/handler/ha_innodb.cc
-
3storage/innobase/include/srv0srv.h
-
3storage/innobase/srv/srv0srv.cc
-
10storage/xtradb/handler/ha_innodb.cc
-
3storage/xtradb/include/srv0srv.h
-
3storage/xtradb/srv/srv0srv.cc
@ -1,71 +0,0 @@ |
|||||
SET @start_global_value = @@global.innodb_default_encryption_key; |
|
||||
SELECT @start_global_value; |
|
||||
@start_global_value |
|
||||
1 |
|
||||
Valid value 0-9 |
|
||||
select @@global.innodb_default_encryption_key <= 9; |
|
||||
@@global.innodb_default_encryption_key <= 9 |
|
||||
1 |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
@@global.innodb_default_encryption_key |
|
||||
1 |
|
||||
select @@session.innodb_default_encryption_key; |
|
||||
ERROR HY000: Variable 'innodb_default_encryption_key' is a GLOBAL variable |
|
||||
show global variables like 'innodb_default_encryption_key'; |
|
||||
Variable_name Value |
|
||||
innodb_default_encryption_key 1 |
|
||||
show session variables like 'innodb_default_encryption_key'; |
|
||||
Variable_name Value |
|
||||
innodb_default_encryption_key 1 |
|
||||
select * from information_schema.global_variables where variable_name='innodb_default_encryption_key'; |
|
||||
VARIABLE_NAME VARIABLE_VALUE |
|
||||
INNODB_DEFAULT_ENCRYPTION_KEY 1 |
|
||||
select * from information_schema.session_variables where variable_name='innodb_default_encryption_key'; |
|
||||
VARIABLE_NAME VARIABLE_VALUE |
|
||||
INNODB_DEFAULT_ENCRYPTION_KEY 1 |
|
||||
set global innodb_default_encryption_key=2; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
@@global.innodb_default_encryption_key |
|
||||
2 |
|
||||
select * from information_schema.global_variables where variable_name='innodb_default_encryption_key'; |
|
||||
VARIABLE_NAME VARIABLE_VALUE |
|
||||
INNODB_DEFAULT_ENCRYPTION_KEY 2 |
|
||||
select * from information_schema.session_variables where variable_name='innodb_default_encryption_key'; |
|
||||
VARIABLE_NAME VARIABLE_VALUE |
|
||||
INNODB_DEFAULT_ENCRYPTION_KEY 2 |
|
||||
set session innodb_default_encryption_key=4; |
|
||||
ERROR HY000: Variable 'innodb_default_encryption_key' is a GLOBAL variable and should be set with SET GLOBAL |
|
||||
set global innodb_default_encryption_key=1.1; |
|
||||
ERROR 42000: Incorrect argument type to variable 'innodb_default_encryption_key' |
|
||||
set global innodb_default_encryption_key=1e1; |
|
||||
ERROR 42000: Incorrect argument type to variable 'innodb_default_encryption_key' |
|
||||
set global innodb_default_encryption_key="foo"; |
|
||||
ERROR 42000: Incorrect argument type to variable 'innodb_default_encryption_key' |
|
||||
set global innodb_default_encryption_key=10; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
@@global.innodb_default_encryption_key |
|
||||
10 |
|
||||
select * from information_schema.global_variables where variable_name='innodb_default_encryption_key'; |
|
||||
VARIABLE_NAME VARIABLE_VALUE |
|
||||
INNODB_DEFAULT_ENCRYPTION_KEY 10 |
|
||||
set global innodb_default_encryption_key=-7; |
|
||||
Warnings: |
|
||||
Warning 1292 Truncated incorrect innodb_default_encryption_key value: '-7' |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
@@global.innodb_default_encryption_key |
|
||||
1 |
|
||||
select * from information_schema.global_variables where variable_name='innodb_default_encryption_key'; |
|
||||
VARIABLE_NAME VARIABLE_VALUE |
|
||||
INNODB_DEFAULT_ENCRYPTION_KEY 1 |
|
||||
set global innodb_default_encryption_key=1; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
@@global.innodb_default_encryption_key |
|
||||
1 |
|
||||
set global innodb_default_encryption_key=255; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
@@global.innodb_default_encryption_key |
|
||||
255 |
|
||||
SET @@global.innodb_default_encryption_key = @start_global_value; |
|
||||
SELECT @@global.innodb_default_encryption_key; |
|
||||
@@global.innodb_default_encryption_key |
|
||||
1 |
|
@ -1,60 +0,0 @@ |
|||||
|
|
||||
--source include/have_innodb.inc |
|
||||
|
|
||||
SET @start_global_value = @@global.innodb_default_encryption_key; |
|
||||
SELECT @start_global_value; |
|
||||
|
|
||||
# |
|
||||
# exists as global only |
|
||||
# |
|
||||
--echo Valid value 0-9 |
|
||||
select @@global.innodb_default_encryption_key <= 9; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
|
||||
select @@session.innodb_default_encryption_key; |
|
||||
show global variables like 'innodb_default_encryption_key'; |
|
||||
show session variables like 'innodb_default_encryption_key'; |
|
||||
select * from information_schema.global_variables where variable_name='innodb_default_encryption_key'; |
|
||||
select * from information_schema.session_variables where variable_name='innodb_default_encryption_key'; |
|
||||
|
|
||||
# |
|
||||
# show that it's writable |
|
||||
# |
|
||||
set global innodb_default_encryption_key=2; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
select * from information_schema.global_variables where variable_name='innodb_default_encryption_key'; |
|
||||
select * from information_schema.session_variables where variable_name='innodb_default_encryption_key'; |
|
||||
--error ER_GLOBAL_VARIABLE |
|
||||
set session innodb_default_encryption_key=4; |
|
||||
|
|
||||
# |
|
||||
# incorrect types |
|
||||
# |
|
||||
--error ER_WRONG_TYPE_FOR_VAR |
|
||||
set global innodb_default_encryption_key=1.1; |
|
||||
--error ER_WRONG_TYPE_FOR_VAR |
|
||||
set global innodb_default_encryption_key=1e1; |
|
||||
--error ER_WRONG_TYPE_FOR_VAR |
|
||||
set global innodb_default_encryption_key="foo"; |
|
||||
|
|
||||
set global innodb_default_encryption_key=10; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
select * from information_schema.global_variables where variable_name='innodb_default_encryption_key'; |
|
||||
set global innodb_default_encryption_key=-7; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
select * from information_schema.global_variables where variable_name='innodb_default_encryption_key'; |
|
||||
|
|
||||
# |
|
||||
# min/max values |
|
||||
# |
|
||||
set global innodb_default_encryption_key=1; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
set global innodb_default_encryption_key=255; |
|
||||
select @@global.innodb_default_encryption_key; |
|
||||
|
|
||||
# |
|
||||
# cleanup |
|
||||
# |
|
||||
|
|
||||
SET @@global.innodb_default_encryption_key = @start_global_value; |
|
||||
SELECT @@global.innodb_default_encryption_key; |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue