| 1 |
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb; |
| 2 |
create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact encrypted=yes encryption_key_id=1; |
| 3 |
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=3; |
| 4 |
ERROR HY000: Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options") |
| 5 |
show warnings; |
| 6 |
Level Code Message |
| 7 |
Warning 140 InnoDB: ENCRYPTION_KEY_ID 3 not available |
| 8 |
Error 1005 Can't create table `test`.`innodb_dynamic` (errno: 140 "Wrong create options") |
| 9 |
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB |
| 10 |
create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic encrypted=yes encryption_key_id=33; |
| 11 |
create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant encrypted=yes encryption_key_id=4; |
| 12 |
show create table innodb_compact; |
| 13 |
Table Create Table |
| 14 |
innodb_compact CREATE TABLE `innodb_compact` ( |
| 15 |
`c1` bigint(20) NOT NULL, |
| 16 |
`b` char(200) DEFAULT NULL |
| 17 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=COMPACT `encrypted`=yes `encryption_key_id`=1 |
| 18 |
show create table innodb_dynamic; |
| 19 |
Table Create Table |
| 20 |
innodb_dynamic CREATE TABLE `innodb_dynamic` ( |
| 21 |
`c1` bigint(20) NOT NULL, |
| 22 |
`b` char(200) DEFAULT NULL |
| 23 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=DYNAMIC `encrypted`=yes `encryption_key_id`=33 |
| 24 |
show create table innodb_redundant; |
| 25 |
Table Create Table |
| 26 |
innodb_redundant CREATE TABLE `innodb_redundant` ( |
| 27 |
`c1` bigint(20) NOT NULL, |
| 28 |
`b` char(200) DEFAULT NULL |
| 29 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=REDUNDANT `encrypted`=yes `encryption_key_id`=4 |
| 30 |
create procedure innodb_insert_proc (repeat_count int) |
| 31 |
begin |
| 32 |
declare current_num int; |
| 33 |
set current_num = 0; |
| 34 |
while current_num < repeat_count do |
| 35 |
insert into innodb_normal values(current_num, substring(MD5(RAND()), -150)); |
| 36 |
set current_num = current_num + 1; |
| 37 |
end while; |
| 38 |
end// |
| 39 |
commit; |
| 40 |
set autocommit=0; |
| 41 |
call innodb_insert_proc(5000); |
| 42 |
commit; |
| 43 |
set autocommit=1; |
| 44 |
insert into innodb_compact select * from innodb_normal; |
| 45 |
insert into innodb_dynamic select * from innodb_normal; |
| 46 |
insert into innodb_redundant select * from innodb_normal; |
| 47 |
update innodb_compact set c1 = c1 + 1; |
| 48 |
update innodb_dynamic set c1 = c1 + 1; |
| 49 |
update innodb_redundant set c1 = c1 + 1; |
| 50 |
select count(*) from innodb_compact where c1 < 1500000; |
| 51 |
count(*) |
| 52 |
5000 |
| 53 |
select count(*) from innodb_dynamic where c1 < 1500000; |
| 54 |
count(*) |
| 55 |
5000 |
| 56 |
select count(*) from innodb_redundant where c1 < 1500000; |
| 57 |
count(*) |
| 58 |
5000 |
| 59 |
# restart |
| 60 |
update innodb_compact set c1 = c1 + 1; |
| 61 |
update innodb_dynamic set c1 = c1 + 1; |
| 62 |
update innodb_redundant set c1 = c1 + 1; |
| 63 |
select count(*) from innodb_compact where c1 < 1500000; |
| 64 |
count(*) |
| 65 |
5000 |
| 66 |
select count(*) from innodb_dynamic where c1 < 1500000; |
| 67 |
count(*) |
| 68 |
5000 |
| 69 |
select count(*) from innodb_redundant where c1 < 1500000; |
| 70 |
count(*) |
| 71 |
5000 |
| 72 |
alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT; |
| 73 |
show create table innodb_compact; |
| 74 |
Table Create Table |
| 75 |
innodb_compact CREATE TABLE `innodb_compact` ( |
| 76 |
`c1` bigint(20) NOT NULL, |
| 77 |
`b` char(200) DEFAULT NULL |
| 78 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=COMPACT |
| 79 |
alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT; |
| 80 |
show create table innodb_dynamic; |
| 81 |
Table Create Table |
| 82 |
innodb_dynamic CREATE TABLE `innodb_dynamic` ( |
| 83 |
`c1` bigint(20) NOT NULL, |
| 84 |
`b` char(200) DEFAULT NULL |
| 85 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=DYNAMIC |
| 86 |
alter table innodb_redundant engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT; |
| 87 |
show create table innodb_redundant; |
| 88 |
Table Create Table |
| 89 |
innodb_redundant CREATE TABLE `innodb_redundant` ( |
| 90 |
`c1` bigint(20) NOT NULL, |
| 91 |
`b` char(200) DEFAULT NULL |
| 92 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=REDUNDANT |
| 93 |
# restart |
| 94 |
show create table innodb_compact; |
| 95 |
Table Create Table |
| 96 |
innodb_compact CREATE TABLE `innodb_compact` ( |
| 97 |
`c1` bigint(20) NOT NULL, |
| 98 |
`b` char(200) DEFAULT NULL |
| 99 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=COMPACT |
| 100 |
show create table innodb_dynamic; |
| 101 |
Table Create Table |
| 102 |
innodb_dynamic CREATE TABLE `innodb_dynamic` ( |
| 103 |
`c1` bigint(20) NOT NULL, |
| 104 |
`b` char(200) DEFAULT NULL |
| 105 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=DYNAMIC |
| 106 |
show create table innodb_redundant; |
| 107 |
Table Create Table |
| 108 |
innodb_redundant CREATE TABLE `innodb_redundant` ( |
| 109 |
`c1` bigint(20) NOT NULL, |
| 110 |
`b` char(200) DEFAULT NULL |
| 111 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci ROW_FORMAT=REDUNDANT |
| 112 |
update innodb_compact set c1 = c1 + 1; |
| 113 |
update innodb_dynamic set c1 = c1 + 1; |
| 114 |
update innodb_redundant set c1 = c1 + 1; |
| 115 |
select count(*) from innodb_compact where c1 < 1500000; |
| 116 |
count(*) |
| 117 |
5000 |
| 118 |
select count(*) from innodb_dynamic where c1 < 1500000; |
| 119 |
count(*) |
| 120 |
5000 |
| 121 |
select count(*) from innodb_redundant where c1 < 1500000; |
| 122 |
count(*) |
| 123 |
5000 |
| 124 |
drop procedure innodb_insert_proc; |
| 125 |
drop table innodb_normal; |
| 126 |
drop table innodb_compact; |
| 127 |
drop table innodb_dynamic; |
| 128 |
drop table innodb_redundant; |