| 1 |
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1; |
| 2 |
show create table t1; |
| 3 |
Table Create Table |
| 4 |
t1 CREATE TABLE `t1` ( |
| 5 |
`c1` bigint(20) NOT NULL, |
| 6 |
`b` char(200) DEFAULT NULL |
| 7 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=yes `encryption_key_id`=1 |
| 8 |
insert t1 values (12345, repeat('1234567890', 20)); |
| 9 |
alter table t1 encryption_key_id=2; |
| 10 |
show create table t1; |
| 11 |
Table Create Table |
| 12 |
t1 CREATE TABLE `t1` ( |
| 13 |
`c1` bigint(20) NOT NULL, |
| 14 |
`b` char(200) DEFAULT NULL |
| 15 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=yes `encryption_key_id`=2 |
| 16 |
alter table t1 encryption_key_id=3; |
| 17 |
ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID' |
| 18 |
show warnings; |
| 19 |
Level Code Message |
| 20 |
Warning 140 InnoDB: ENCRYPTION_KEY_ID 3 not available |
| 21 |
Error 1478 Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID' |
| 22 |
show create table t1; |
| 23 |
Table Create Table |
| 24 |
t1 CREATE TABLE `t1` ( |
| 25 |
`c1` bigint(20) NOT NULL, |
| 26 |
`b` char(200) DEFAULT NULL |
| 27 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=yes `encryption_key_id`=2 |
| 28 |
alter table t1 encryption_key_id=33; |
| 29 |
show create table t1; |
| 30 |
Table Create Table |
| 31 |
t1 CREATE TABLE `t1` ( |
| 32 |
`c1` bigint(20) NOT NULL, |
| 33 |
`b` char(200) DEFAULT NULL |
| 34 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=yes `encryption_key_id`=33 |
| 35 |
alter table t1 encryption_key_id=4; |
| 36 |
show create table t1; |
| 37 |
Table Create Table |
| 38 |
t1 CREATE TABLE `t1` ( |
| 39 |
`c1` bigint(20) NOT NULL, |
| 40 |
`b` char(200) DEFAULT NULL |
| 41 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci `encrypted`=yes `encryption_key_id`=4 |
| 42 |
drop table t1; |