mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
move encryption tests to a dedicate suite
remove few tests for variables that never existed (merge error)
This commit is contained in:
19
mysql-test/suite/encryption/r/debug_key_management.result
Normal file
19
mysql-test/suite/encryption/r/debug_key_management.result
Normal file
@@ -0,0 +1,19 @@
|
||||
show variables like 'innodb_encrypt%';
|
||||
Variable_name Value
|
||||
innodb_encrypt_log ON
|
||||
innodb_encrypt_tables ON
|
||||
innodb_encryption_rotate_key_age 2
|
||||
innodb_encryption_rotation_iops 100
|
||||
innodb_encryption_threads 4
|
||||
select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
|
||||
space name current_key_version
|
||||
0 NULL 1
|
||||
1 mysql/innodb_table_stats 1
|
||||
2 mysql/innodb_index_stats 1
|
||||
set global debug_key_management_version=10;
|
||||
select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
|
||||
space name current_key_version
|
||||
0 NULL 10
|
||||
1 mysql/innodb_table_stats 10
|
||||
2 mysql/innodb_index_stats 10
|
||||
set global debug_key_management_version=1;
|
47
mysql-test/suite/encryption/r/encryption_force.result
Normal file
47
mysql-test/suite/encryption/r/encryption_force.result
Normal file
@@ -0,0 +1,47 @@
|
||||
select @@innodb_encrypt_tables;
|
||||
@@innodb_encrypt_tables
|
||||
FORCE
|
||||
create table t1 (a int) engine=innodb encrypted=yes;
|
||||
create table t2 (a int) engine=innodb encrypted=default;
|
||||
create table t3 (a int) engine=innodb encrypted=no;
|
||||
ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options")
|
||||
set global innodb_encrypt_tables='ON';
|
||||
create table t3 (a int) engine=innodb encrypted=no;
|
||||
set global innodb_encrypt_tables='FORCE';
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=no
|
||||
alter table t1 encrypted=no;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
|
||||
alter table t2 encrypted=yes;
|
||||
alter table t3 encrypted=default;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
|
||||
show create table t2;
|
||||
Table Create Table
|
||||
t2 CREATE TABLE `t2` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes
|
||||
show create table t3;
|
||||
Table Create Table
|
||||
t3 CREATE TABLE `t3` (
|
||||
`a` int(11) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
drop table t3;
|
38
mysql-test/suite/encryption/r/filekeys_encfile.result
Normal file
38
mysql-test/suite/encryption/r/filekeys_encfile.result
Normal file
@@ -0,0 +1,38 @@
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=1
|
||||
insert t1 values (12345, repeat('1234567890', 20));
|
||||
alter table t1 encryption_key_id=2;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
|
||||
alter table t1 encryption_key_id=3;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
|
||||
alter table t1 encryption_key_id=33;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=33
|
||||
alter table t1 encryption_key_id=4;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=4
|
||||
drop table t1;
|
@@ -0,0 +1,9 @@
|
||||
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
@@ -0,0 +1,9 @@
|
||||
call mtr.add_suppression("File 'bad' not found");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /File 'bad' not found/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
38
mysql-test/suite/encryption/r/filekeys_encfile_file.result
Normal file
38
mysql-test/suite/encryption/r/filekeys_encfile_file.result
Normal file
@@ -0,0 +1,38 @@
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=1
|
||||
insert t1 values (12345, repeat('1234567890', 20));
|
||||
alter table t1 encryption_key_id=2;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
|
||||
alter table t1 encryption_key_id=3;
|
||||
ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=2
|
||||
alter table t1 encryption_key_id=33;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=33
|
||||
alter table t1 encryption_key_id=4;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `encryption_key_id`=4
|
||||
drop table t1;
|
9
mysql-test/suite/encryption/r/filekeys_encfile_no.result
Normal file
9
mysql-test/suite/encryption/r/filekeys_encfile_no.result
Normal file
@@ -0,0 +1,9 @@
|
||||
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
9
mysql-test/suite/encryption/r/filekeys_nofile.result
Normal file
9
mysql-test/suite/encryption/r/filekeys_nofile.result
Normal file
@@ -0,0 +1,9 @@
|
||||
call mtr.add_suppression("File '' not found");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /File '' not found/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
129
mysql-test/suite/encryption/r/filekeys_syntax.result
Normal file
129
mysql-test/suite/encryption/r/filekeys_syntax.result
Normal file
@@ -0,0 +1,129 @@
|
||||
call mtr.add_suppression("File '.*keys.txt' not found");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /File '.*keys.txt' not found/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
install soname 'file_key_management';
|
||||
ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 2
|
||||
call mtr.add_suppression("File '.*keys.txt' not found");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /File '.*keys.txt' not found/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
call mtr.add_suppression("Invalid key id");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Invalid key id/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
install soname 'file_key_management';
|
||||
ERROR HY000: Invalid key id at MYSQL_TMP_DIR/keys.txt line 2, column 11
|
||||
call mtr.add_suppression("Invalid key id");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Invalid key id/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
call mtr.add_suppression("Invalid key id");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Invalid key id/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
install soname 'file_key_management';
|
||||
ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 47
|
||||
call mtr.add_suppression("Invalid key id");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Invalid key id/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
call mtr.add_suppression("Invalid key");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Invalid key/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
install soname 'file_key_management';
|
||||
ERROR HY000: Invalid key at MYSQL_TMP_DIR/keys.txt line 2, column 33
|
||||
call mtr.add_suppression("Invalid key");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Invalid key/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
call mtr.add_suppression("Invalid key");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Invalid key/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
install soname 'file_key_management';
|
||||
ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, column 2
|
||||
call mtr.add_suppression("Invalid key");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Invalid key/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
call mtr.add_suppression("Syntax error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Syntax error/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
install soname 'file_key_management';
|
||||
ERROR HY000: Syntax error at MYSQL_TMP_DIR/keys.txt line 2, column 1
|
||||
call mtr.add_suppression("Syntax error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Syntax error/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
||||
call mtr.add_suppression("Syntax error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Syntax error/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
9
mysql-test/suite/encryption/r/filekeys_unencfile.result
Normal file
9
mysql-test/suite/encryption/r/filekeys_unencfile.result
Normal file
@@ -0,0 +1,9 @@
|
||||
call mtr.add_suppression("Cannot decrypt .*keys.txt. Not encrypted");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
|
||||
FOUND /Cannot decrypt .*keys.txt. Not encrypted/ in mysqld.1.err
|
||||
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
|
||||
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
|
||||
select plugin_status from information_schema.plugins
|
||||
where plugin_name = 'file_key_management';
|
||||
plugin_status
|
125
mysql-test/suite/encryption/r/innodb-page_encryption-32k.result
Normal file
125
mysql-test/suite/encryption/r/innodb-page_encryption-32k.result
Normal file
@@ -0,0 +1,125 @@
|
||||
call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
|
||||
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
|
||||
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
|
||||
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=3
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4
|
||||
create procedure innodb_insert_proc (repeat_count int)
|
||||
begin
|
||||
declare current_num int;
|
||||
set current_num = 0;
|
||||
while current_num < repeat_count do
|
||||
insert into innodb_normal values(current_num, substring(MD5(RAND()), -150));
|
||||
set current_num = current_num + 1;
|
||||
end while;
|
||||
end//
|
||||
commit;
|
||||
set autocommit=0;
|
||||
call innodb_insert_proc(5000);
|
||||
commit;
|
||||
set autocommit=1;
|
||||
insert into innodb_compact select * from innodb_normal;
|
||||
insert into innodb_dynamic select * from innodb_normal;
|
||||
insert into innodb_redundant select * from innodb_normal;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
Warnings:
|
||||
Warning 1478 InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope.
|
||||
Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
drop procedure innodb_insert_proc;
|
||||
drop table innodb_normal;
|
||||
drop table innodb_compact;
|
||||
drop table innodb_dynamic;
|
||||
drop table innodb_redundant;
|
262
mysql-test/suite/encryption/r/innodb-page_encryption.result
Normal file
262
mysql-test/suite/encryption/r/innodb-page_encryption.result
Normal file
@@ -0,0 +1,262 @@
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
|
||||
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
|
||||
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2;
|
||||
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3;
|
||||
ERROR HY000: Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options")
|
||||
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
|
||||
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
|
||||
set innodb_default_encryption_key_id = 5;
|
||||
create table innodb_defkey(c1 bigint not null, b char(200)) engine=innodb encrypted=yes;
|
||||
show create table innodb_defkey;
|
||||
Table Create Table
|
||||
innodb_defkey CREATE TABLE `innodb_defkey` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `ENCRYPTION_KEY_ID`=5
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1
|
||||
show create table innodb_compressed;
|
||||
Table Create Table
|
||||
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes `encryption_key_id`=2
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=33
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4
|
||||
create procedure innodb_insert_proc (repeat_count int)
|
||||
begin
|
||||
declare current_num int;
|
||||
set current_num = 0;
|
||||
while current_num < repeat_count do
|
||||
insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
|
||||
set current_num = current_num + 1;
|
||||
end while;
|
||||
end//
|
||||
commit;
|
||||
set autocommit=0;
|
||||
call innodb_insert_proc(2000);
|
||||
commit;
|
||||
set autocommit=1;
|
||||
insert into innodb_compact select * from innodb_normal;
|
||||
insert into innodb_compressed select * from innodb_normal;
|
||||
insert into innodb_dynamic select * from innodb_normal;
|
||||
insert into innodb_redundant select * from innodb_normal;
|
||||
insert into innodb_defkey select * from innodb_normal;
|
||||
update innodb_normal set c1 = c1 +1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_compressed set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
update innodb_defkey set c1 = c1 + 1;
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_defkey where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_defkey t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
update innodb_normal set c1 = c1 +1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_compressed set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
update innodb_defkey set c1 = c1 + 1;
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_defkey where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_defkey t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_compressed;
|
||||
Table Create Table
|
||||
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
|
||||
alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
show create table innodb_compressed;
|
||||
Table Create Table
|
||||
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
|
||||
show create table innodb_defkey;
|
||||
Table Create Table
|
||||
innodb_defkey CREATE TABLE `innodb_defkey` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `encrypted`=yes `ENCRYPTION_KEY_ID`=5
|
||||
update innodb_normal set c1 = c1 +1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_compressed set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value = 0
|
||||
1
|
||||
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value = 0
|
||||
1
|
||||
drop procedure innodb_insert_proc;
|
||||
drop table innodb_normal;
|
||||
drop table innodb_compact;
|
||||
drop table innodb_compressed;
|
||||
drop table innodb_dynamic;
|
||||
drop table innodb_redundant;
|
||||
drop table innodb_defkey;
|
@@ -0,0 +1,180 @@
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
set global innodb_compression_algorithm = 1;
|
||||
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
|
||||
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1 page_compressed=1;
|
||||
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=2 page_compressed=1;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
show create table innodb_normal;
|
||||
Table Create Table
|
||||
innodb_normal CREATE TABLE `innodb_normal` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1 `page_compressed`=1
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=2 `page_compressed`=1
|
||||
create procedure innodb_insert_proc (repeat_count int)
|
||||
begin
|
||||
declare current_num int;
|
||||
set current_num = 0;
|
||||
while current_num < repeat_count do
|
||||
insert into innodb_normal values(current_num, substring(MD5(RAND()), -128));
|
||||
set current_num = current_num + 1;
|
||||
end while;
|
||||
end//
|
||||
commit;
|
||||
set autocommit=0;
|
||||
call innodb_insert_proc(5000);
|
||||
commit;
|
||||
set autocommit=1;
|
||||
insert into innodb_compact select * from innodb_normal;
|
||||
insert into innodb_dynamic select * from innodb_normal;
|
||||
update innodb_normal set c1 = c1 + 1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
select count(*) from innodb_normal;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
5000
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_compressed';
|
||||
variable_value >= 0
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decompressed';
|
||||
variable_value >= 0
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
set global innodb_compression_algorithm = 1;
|
||||
update innodb_normal set c1 = c1 + 1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
select count(*) from innodb_normal;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
5000
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_compressed';
|
||||
variable_value >= 0
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decompressed';
|
||||
variable_value >= 0
|
||||
alter table innodb_normal engine=innodb page_compressed=DEFAULT;
|
||||
show create table innodb_normal;
|
||||
Table Create Table
|
||||
innodb_normal CREATE TABLE `innodb_normal` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT;
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
show create table innodb_normal;
|
||||
Table Create Table
|
||||
innodb_normal CREATE TABLE `innodb_normal` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
update innodb_normal set c1 = c1 + 1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
select count(*) from innodb_normal;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
5000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
5000
|
||||
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value = 0
|
||||
1
|
||||
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value = 0
|
||||
1
|
||||
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_compressed';
|
||||
variable_value = 0
|
||||
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decompressed';
|
||||
variable_value = 0
|
||||
drop procedure innodb_insert_proc;
|
||||
drop table innodb_normal;
|
||||
drop table innodb_compact;
|
||||
drop table innodb_dynamic;
|
@@ -0,0 +1,231 @@
|
||||
call mtr.add_suppression("KeyID 0 not found or with error. Check the key and the log*");
|
||||
call mtr.add_suppression("Disabling redo log encryp*");
|
||||
call mtr.add_suppression("InnoDB: Redo log crypto: Can't initialize to key version*");
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
|
||||
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1;
|
||||
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=2;
|
||||
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33;
|
||||
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4;
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1
|
||||
show create table innodb_compressed;
|
||||
Table Create Table
|
||||
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED `encrypted`=yes `encryption_key_id`=2
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=33
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4
|
||||
create procedure innodb_insert_proc (repeat_count int)
|
||||
begin
|
||||
declare current_num int;
|
||||
set current_num = 0;
|
||||
while current_num < repeat_count do
|
||||
insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
|
||||
set current_num = current_num + 1;
|
||||
end while;
|
||||
end//
|
||||
commit;
|
||||
set autocommit=0;
|
||||
call innodb_insert_proc(2000);
|
||||
commit;
|
||||
set autocommit=1;
|
||||
insert into innodb_compact select * from innodb_normal;
|
||||
insert into innodb_compressed select * from innodb_normal;
|
||||
insert into innodb_dynamic select * from innodb_normal;
|
||||
insert into innodb_redundant select * from innodb_normal;
|
||||
update innodb_normal set c1 = c1 +1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_compressed set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
update innodb_normal set c1 = c1 +1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_compressed set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
alter table innodb_compressed engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_compressed;
|
||||
Table Create Table
|
||||
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
|
||||
alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT;
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
show create table innodb_compressed;
|
||||
Table Create Table
|
||||
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
|
||||
update innodb_normal set c1 = c1 +1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_compressed set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value = 0
|
||||
1
|
||||
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value = 0
|
||||
1
|
||||
drop procedure innodb_insert_proc;
|
||||
drop table innodb_normal;
|
||||
drop table innodb_compact;
|
||||
drop table innodb_compressed;
|
||||
drop table innodb_dynamic;
|
||||
drop table innodb_redundant;
|
@@ -0,0 +1,3 @@
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
set global innodb_compression_algorithm = 1;
|
57
mysql-test/suite/encryption/r/innodb_encryption.result
Normal file
57
mysql-test/suite/encryption/r/innodb_encryption.result
Normal file
@@ -0,0 +1,57 @@
|
||||
SET @start_global_value = @@global.innodb_encryption_threads;
|
||||
SHOW VARIABLES LIKE 'innodb_encrypt%';
|
||||
Variable_name Value
|
||||
innodb_encrypt_log ON
|
||||
innodb_encrypt_tables ON
|
||||
innodb_encryption_rotate_key_age 15
|
||||
innodb_encryption_rotation_iops 100
|
||||
innodb_encryption_threads 4
|
||||
DESCRIBE INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
|
||||
Field Type Null Key Default Extra
|
||||
SPACE int(11) unsigned NO 0
|
||||
NAME varchar(655) YES NULL
|
||||
ENCRYPTION_SCHEME int(11) unsigned NO 0
|
||||
KEYSERVER_REQUESTS int(11) unsigned NO 0
|
||||
MIN_KEY_VERSION int(11) unsigned NO 0
|
||||
CURRENT_KEY_VERSION int(11) unsigned NO 0
|
||||
KEY_ROTATION_PAGE_NUMBER bigint(21) unsigned YES NULL
|
||||
KEY_ROTATION_MAX_PAGE_NUMBER bigint(21) unsigned YES NULL
|
||||
# Wait max 5 min for key encryption threads to encrypt one space
|
||||
# Success!
|
||||
# Wait max 10 min for key encryption threads to encrypt all space
|
||||
# Success!
|
||||
# Now turn off encryption and wait for threads to decrypt everything
|
||||
SET GLOBAL innodb_encrypt_tables = off;
|
||||
# Wait max 10 min for key encryption threads to decrypt all space
|
||||
# Success!
|
||||
# Shutdown innodb_encryption_threads
|
||||
SET GLOBAL innodb_encryption_threads=0;
|
||||
# Turn on encryption
|
||||
# since threads are off tables should remain unencrypted
|
||||
SET GLOBAL innodb_encrypt_tables = on;
|
||||
# Wait 15s to check that nothing gets encrypted
|
||||
# Success!
|
||||
# Startup innodb_encryption_threads
|
||||
SET GLOBAL innodb_encryption_threads=@start_global_value;
|
||||
# Wait 1 min to check that it start encrypting again
|
||||
# Success!
|
||||
#
|
||||
# Check that restart with encryption turned off works
|
||||
# even if spaces are encrypted
|
||||
#
|
||||
# First wait max 10 min for key encryption threads to encrypt all spaces
|
||||
# Success!
|
||||
# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
|
||||
SHOW VARIABLES LIKE 'innodb_encrypt%';
|
||||
Variable_name Value
|
||||
innodb_encrypt_log ON
|
||||
innodb_encrypt_tables OFF
|
||||
innodb_encryption_rotate_key_age 15
|
||||
innodb_encryption_rotation_iops 100
|
||||
innodb_encryption_threads 0
|
||||
SELECT COUNT(*) > 0 as should_be_1
|
||||
FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
|
||||
WHERE MIN_KEY_VERSION <> 0;
|
||||
should_be_1
|
||||
1
|
||||
# Restart mysqld again...with default options
|
161
mysql-test/suite/encryption/r/innodb_encryption_tables.result
Normal file
161
mysql-test/suite/encryption/r/innodb_encryption_tables.result
Normal file
@@ -0,0 +1,161 @@
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
|
||||
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact;
|
||||
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic;
|
||||
create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed;
|
||||
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
show create table innodb_normal;
|
||||
Table Create Table
|
||||
innodb_normal CREATE TABLE `innodb_normal` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1
|
||||
show create table innodb_compact;
|
||||
Table Create Table
|
||||
innodb_compact CREATE TABLE `innodb_compact` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT
|
||||
show create table innodb_dynamic;
|
||||
Table Create Table
|
||||
innodb_dynamic CREATE TABLE `innodb_dynamic` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
|
||||
show create table innodb_compressed;
|
||||
Table Create Table
|
||||
innodb_compressed CREATE TABLE `innodb_compressed` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
|
||||
show create table innodb_redundant;
|
||||
Table Create Table
|
||||
innodb_redundant CREATE TABLE `innodb_redundant` (
|
||||
`c1` bigint(20) NOT NULL,
|
||||
`b` char(200) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
|
||||
create procedure innodb_insert_proc (repeat_count int)
|
||||
begin
|
||||
declare current_num int;
|
||||
set current_num = 0;
|
||||
while current_num < repeat_count do
|
||||
insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
|
||||
set current_num = current_num + 1;
|
||||
end while;
|
||||
end//
|
||||
commit;
|
||||
set autocommit=0;
|
||||
call innodb_insert_proc(2000);
|
||||
commit;
|
||||
set autocommit=1;
|
||||
insert into innodb_compact select * from innodb_normal;
|
||||
insert into innodb_dynamic select * from innodb_normal;
|
||||
insert into innodb_compressed select * from innodb_normal;
|
||||
insert into innodb_redundant select * from innodb_normal;
|
||||
update innodb_normal set c1 = c1 + 1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_compressed set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
select count(*) from innodb_normal;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
|
||||
variable_value >= 0
|
||||
1
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
update innodb_normal set c1 = c1 + 1;
|
||||
update innodb_compact set c1 = c1 + 1;
|
||||
update innodb_dynamic set c1 = c1 + 1;
|
||||
update innodb_compressed set c1 = c1 + 1;
|
||||
update innodb_redundant set c1 = c1 + 1;
|
||||
select count(*) from innodb_normal;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant where c1 < 1500000;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compact t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_dynamic t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_compressed t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
select count(*) from innodb_redundant t1, innodb_normal t2 where
|
||||
t1.c1 = t2.c1 and t1.b = t2.b;
|
||||
count(*)
|
||||
2000
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed';
|
||||
variable_value >= 0
|
||||
1
|
||||
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed';
|
||||
variable_value >= 0
|
||||
1
|
||||
drop procedure innodb_insert_proc;
|
||||
drop table innodb_normal;
|
||||
drop table innodb_compact;
|
||||
drop table innodb_dynamic;
|
||||
drop table innodb_compressed;
|
||||
drop table innodb_redundant;
|
5
mysql-test/suite/encryption/r/innodb_first_page.result
Normal file
5
mysql-test/suite/encryption/r/innodb_first_page.result
Normal file
@@ -0,0 +1,5 @@
|
||||
call mtr.add_suppression("InnoDB: New log files created, LSN");
|
||||
call mtr.add_suppression("InnoDB: Creating foreign key constraint system tables");
|
||||
shutdown;
|
||||
create table t1 (a int);
|
||||
drop table t1;
|
224
mysql-test/suite/encryption/r/innodb_scrub.result
Normal file
224
mysql-test/suite/encryption/r/innodb_scrub.result
Normal file
@@ -0,0 +1,224 @@
|
||||
create table snapshot_status engine = myisam
|
||||
select * from information_schema.global_status
|
||||
where variable_name like 'innodb_scrub%';
|
||||
#
|
||||
# Test delete of records
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=compact;
|
||||
# Populate table with rows
|
||||
delete from t1;
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# compact: delete from: grep -c bicycle t1.ibd
|
||||
0
|
||||
# compact: delete from: grep -c bicycle ibdata1
|
||||
0
|
||||
# compact: delete from: grep -c repairman t1.ibd
|
||||
0
|
||||
# compact: delete from: grep -c repairman ibdata1
|
||||
0
|
||||
drop table t1;
|
||||
#
|
||||
# Test delete+rollback+delete
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=compact;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
delete from t1;
|
||||
rollback;
|
||||
delete from t1;
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# compact: delete rollback: grep -c bicycle t1.ibd
|
||||
0
|
||||
# compact: delete rollback: grep -c bicycle ibdata1
|
||||
0
|
||||
# compact: delete rollback: grep -c repairman t1.ibd
|
||||
0
|
||||
# compact: delete rollback: grep -c repairman ibdata1
|
||||
0
|
||||
drop table t1;
|
||||
#
|
||||
# Test insert+rollback
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=compact;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
rollback;
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# compact: insert rollback: grep -c bicycle t1.ibd
|
||||
0
|
||||
# compact: insert rollback: grep -c bicycle ibdata1
|
||||
0
|
||||
# compact: insert rollback: grep -c repairman t1.ibd
|
||||
0
|
||||
# compact: insert rollback: grep -c repairman ibdata1
|
||||
0
|
||||
drop table t1;
|
||||
#
|
||||
# Test delete of records
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=redundant;
|
||||
# Populate table with rows
|
||||
delete from t1;
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# redundant: delete from: grep -c bicycle t1.ibd
|
||||
0
|
||||
# redundant: delete from: grep -c bicycle ibdata1
|
||||
0
|
||||
# redundant: delete from: grep -c repairman t1.ibd
|
||||
0
|
||||
# redundant: delete from: grep -c repairman ibdata1
|
||||
0
|
||||
drop table t1;
|
||||
#
|
||||
# Test delete+rollback+delete
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=redundant;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
delete from t1;
|
||||
rollback;
|
||||
delete from t1;
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# redundant: delete rollback: grep -c bicycle t1.ibd
|
||||
0
|
||||
# redundant: delete rollback: grep -c bicycle ibdata1
|
||||
0
|
||||
# redundant: delete rollback: grep -c repairman t1.ibd
|
||||
0
|
||||
# redundant: delete rollback: grep -c repairman ibdata1
|
||||
0
|
||||
drop table t1;
|
||||
#
|
||||
# Test insert+rollback
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=redundant;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
rollback;
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# redundant: insert rollback: grep -c bicycle t1.ibd
|
||||
0
|
||||
# redundant: insert rollback: grep -c bicycle ibdata1
|
||||
0
|
||||
# redundant: insert rollback: grep -c repairman t1.ibd
|
||||
0
|
||||
# redundant: insert rollback: grep -c repairman ibdata1
|
||||
0
|
||||
drop table t1;
|
||||
#
|
||||
# Test delete of records
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=dynamic;
|
||||
# Populate table with rows
|
||||
delete from t1;
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# dynamic: delete from: grep -c bicycle t1.ibd
|
||||
0
|
||||
# dynamic: delete from: grep -c bicycle ibdata1
|
||||
0
|
||||
# dynamic: delete from: grep -c repairman t1.ibd
|
||||
0
|
||||
# dynamic: delete from: grep -c repairman ibdata1
|
||||
0
|
||||
drop table t1;
|
||||
#
|
||||
# Test delete+rollback+delete
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=dynamic;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
delete from t1;
|
||||
rollback;
|
||||
delete from t1;
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# dynamic: delete rollback: grep -c bicycle t1.ibd
|
||||
0
|
||||
# dynamic: delete rollback: grep -c bicycle ibdata1
|
||||
0
|
||||
# dynamic: delete rollback: grep -c repairman t1.ibd
|
||||
0
|
||||
# dynamic: delete rollback: grep -c repairman ibdata1
|
||||
0
|
||||
drop table t1;
|
||||
#
|
||||
# Test insert+rollback
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=dynamic;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
rollback;
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# dynamic: insert rollback: grep -c bicycle t1.ibd
|
||||
0
|
||||
# dynamic: insert rollback: grep -c bicycle ibdata1
|
||||
0
|
||||
# dynamic: insert rollback: grep -c repairman t1.ibd
|
||||
0
|
||||
# dynamic: insert rollback: grep -c repairman ibdata1
|
||||
0
|
||||
drop table t1;
|
||||
show variables like 'innodb_%scrub_data%';
|
||||
Variable_name Value
|
||||
innodb_background_scrub_data_check_interval 3600
|
||||
innodb_background_scrub_data_compressed OFF
|
||||
innodb_background_scrub_data_interval 604800
|
||||
innodb_background_scrub_data_uncompressed OFF
|
||||
innodb_immediate_scrub_data_uncompressed ON
|
||||
# verify that this test have not caused any background scrubbing
|
||||
select ss.variable_name, gs.variable_value - ss.variable_value as variable_value
|
||||
from snapshot_status ss,
|
||||
information_schema.global_status gs
|
||||
where ss.variable_name = gs.variable_name;
|
||||
variable_name variable_value
|
||||
INNODB_SCRUB_BACKGROUND_PAGE_REORGANIZATIONS 0
|
||||
INNODB_SCRUB_BACKGROUND_PAGE_SPLITS 0
|
||||
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_MISSING_INDEX 0
|
||||
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_OUT_OF_FILESPACE 0
|
||||
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_UNDERFLOW 0
|
||||
INNODB_SCRUB_BACKGROUND_PAGE_SPLIT_FAILURES_UNKNOWN 0
|
||||
drop table snapshot_status;
|
88
mysql-test/suite/encryption/r/innodb_scrub_background.result
Normal file
88
mysql-test/suite/encryption/r/innodb_scrub_background.result
Normal file
@@ -0,0 +1,88 @@
|
||||
#
|
||||
# immediate scrubbing is off
|
||||
# background scrubbing is on
|
||||
#
|
||||
show variables like 'innodb_%scrub_data%';
|
||||
Variable_name Value
|
||||
innodb_background_scrub_data_check_interval 3600
|
||||
innodb_background_scrub_data_compressed ON
|
||||
innodb_background_scrub_data_interval 604800
|
||||
innodb_background_scrub_data_uncompressed ON
|
||||
innodb_immediate_scrub_data_uncompressed OFF
|
||||
# make sure spaces are checked quickly
|
||||
SET GLOBAL innodb_background_scrub_data_check_interval=1;
|
||||
create table snapshot_status engine = myisam
|
||||
select * from information_schema.global_status
|
||||
where variable_name like 'innodb_scrub%';
|
||||
truncate table snapshot_status;
|
||||
insert into snapshot_status
|
||||
select * from information_schema.global_status
|
||||
where variable_name like 'innodb_scrub%';
|
||||
#
|
||||
# Test delete of records
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text, index(b)) engine = innodb row_format=dynamic;
|
||||
# Populate table with rows
|
||||
delete from t1;
|
||||
#
|
||||
# Test delete+rollback+delete
|
||||
#
|
||||
create table t2 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text, index(b)) engine = innodb row_format=dynamic;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
delete from t2;
|
||||
rollback;
|
||||
delete from t2;
|
||||
#
|
||||
# Test insert+rollback
|
||||
#
|
||||
create table t3 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text, index(b)) engine = innodb row_format=dynamic;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
rollback;
|
||||
# start scrubbing threads
|
||||
SET GLOBAL innodb_encryption_threads=5;
|
||||
# Wait max 10 min for scrubbing
|
||||
# Success!
|
||||
# stop scrubbing threads
|
||||
SET GLOBAL innodb_encryption_threads=0;
|
||||
# verify that this test have caused background scrubbing
|
||||
select sum(gs.variable_value - ss.variable_value) > 0 as should_be_1
|
||||
from snapshot_status ss,
|
||||
information_schema.global_status gs
|
||||
where ss.variable_name = gs.variable_name;
|
||||
should_be_1
|
||||
1
|
||||
# restart mysqld so that all pages are flushed
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
# dynamic: delete: grep -c bicycle t1.ibd
|
||||
0
|
||||
# dynamic: delete: grep -c repairman t1.ibd
|
||||
0
|
||||
# dynamic: delete rollback: grep -c bicycle t2.ibd
|
||||
0
|
||||
# dynamic: delete rollback: grep -c repairman t2.ibd
|
||||
0
|
||||
# dynamic: insert rollback: grep -c bicycle t3.ibd
|
||||
0
|
||||
# dynamic: insert rollback: grep -c repairman t3.ibd
|
||||
0
|
||||
drop table t1, t2, t3;
|
||||
show variables like 'innodb_%scrub_data%';
|
||||
Variable_name Value
|
||||
innodb_background_scrub_data_check_interval 3600
|
||||
innodb_background_scrub_data_compressed ON
|
||||
innodb_background_scrub_data_interval 604800
|
||||
innodb_background_scrub_data_uncompressed ON
|
||||
innodb_immediate_scrub_data_uncompressed OFF
|
||||
drop table snapshot_status;
|
71
mysql-test/suite/encryption/r/innodb_scrub_compressed.result
Normal file
71
mysql-test/suite/encryption/r/innodb_scrub_compressed.result
Normal file
@@ -0,0 +1,71 @@
|
||||
# make sure spaces are checked quickly
|
||||
SET GLOBAL innodb_background_scrub_data_check_interval=1;
|
||||
#
|
||||
# Test delete of records
|
||||
#
|
||||
create table t1 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=compressed;
|
||||
# Populate table with rows
|
||||
delete from t1;
|
||||
#
|
||||
# Test delete+rollback+delete
|
||||
#
|
||||
create table t2 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=compressed;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
delete from t2;
|
||||
rollback;
|
||||
delete from t2;
|
||||
#
|
||||
# Test insert+rollback
|
||||
#
|
||||
create table t3 (
|
||||
a int auto_increment primary key,
|
||||
b varchar(256),
|
||||
c text) engine = innodb row_format=compressed;
|
||||
# Populate table with rows
|
||||
begin;
|
||||
rollback;
|
||||
# start scrubbing threads
|
||||
SET GLOBAL innodb_encryption_threads=5;
|
||||
# Wait max 10 min for scrubbing of this table
|
||||
# Success!
|
||||
# stop scrubbing threads
|
||||
SET GLOBAL innodb_encryption_threads=0;
|
||||
# Now there should be background scrubs
|
||||
# restart mysqld so that all pages are flushed (encryption off)
|
||||
# so that grep will find stuff
|
||||
# read all rows from table
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
select * from t3;
|
||||
# grep -c bicycle t1.ibd
|
||||
0
|
||||
# grep -c bicycle ibdata1
|
||||
0
|
||||
# grep -c repairman t1.ibd
|
||||
0
|
||||
# grep -c repairman ibdata1
|
||||
0
|
||||
# grep -c boondoggle t2.ibd
|
||||
0
|
||||
# grep -c boondoggle ibdata1
|
||||
0
|
||||
# grep -c waste t2.ibd
|
||||
0
|
||||
# grep -c waste ibdata1
|
||||
0
|
||||
# grep -c keso t3.ibd
|
||||
0
|
||||
# grep -c keso ibdata1
|
||||
0
|
||||
# grep -c kent t3.ibd
|
||||
0
|
||||
# grep -c kent ibdata1
|
||||
0
|
||||
drop table t1, t2, t3;
|
Reference in New Issue
Block a user