| 1 |
select @@innodb_encrypt_tables; |
| 2 |
@@innodb_encrypt_tables |
| 3 |
FORCE |
| 4 |
create table t1 (a int) engine=innodb encrypted=yes; |
| 5 |
create table t2 (a int) engine=innodb encrypted=default; |
| 6 |
create table t3 (a int) engine=innodb encrypted=no; |
| 7 |
ERROR HY000: Can't create table `test`.`t3` (errno: 140 "Wrong create options") |
| 8 |
create table t4 (a int) engine=innodb encrypted=yes partition by hash(a) partitions 2; |
| 9 |
create table t5 (a int) engine=innodb encrypted=no partition by hash(a) partitions 2; |
| 10 |
ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options") |
| 11 |
set global innodb_encrypt_tables='ON'; |
| 12 |
create table t3 (a int) engine=innodb encrypted=no; |
| 13 |
set global innodb_encrypt_tables='FORCE'; |
| 14 |
show create table t1; |
| 15 |
Table Create Table |
| 16 |
t1 CREATE TABLE `t1` ( |
| 17 |
`a` int(11) DEFAULT NULL |
| 18 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=yes |
| 19 |
show create table t2; |
| 20 |
Table Create Table |
| 21 |
t2 CREATE TABLE `t2` ( |
| 22 |
`a` int(11) DEFAULT NULL |
| 23 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 24 |
show create table t3; |
| 25 |
Table Create Table |
| 26 |
t3 CREATE TABLE `t3` ( |
| 27 |
`a` int(11) DEFAULT NULL |
| 28 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=no |
| 29 |
show create table t4; |
| 30 |
Table Create Table |
| 31 |
t4 CREATE TABLE `t4` ( |
| 32 |
`a` int(11) DEFAULT NULL |
| 33 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=yes |
| 34 |
PARTITION BY HASH (`a`) |
| 35 |
PARTITIONS 2 |
| 36 |
alter table t1 encrypted=no; |
| 37 |
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTED' |
| 38 |
alter table t2 encrypted=yes; |
| 39 |
alter table t3 encrypted=default; |
| 40 |
alter table t4 encrypted=no; |
| 41 |
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTED' |
| 42 |
show create table t1; |
| 43 |
Table Create Table |
| 44 |
t1 CREATE TABLE `t1` ( |
| 45 |
`a` int(11) DEFAULT NULL |
| 46 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=yes |
| 47 |
show create table t2; |
| 48 |
Table Create Table |
| 49 |
t2 CREATE TABLE `t2` ( |
| 50 |
`a` int(11) DEFAULT NULL |
| 51 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=yes |
| 52 |
show create table t3; |
| 53 |
Table Create Table |
| 54 |
t3 CREATE TABLE `t3` ( |
| 55 |
`a` int(11) DEFAULT NULL |
| 56 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 57 |
drop table t1; |
| 58 |
drop table t2; |
| 59 |
drop table t3; |
| 60 |
drop table t4; |