| 1 |
set global innodb_compression_algorithm = 1; |
| 2 |
create database enctests; |
| 3 |
use enctests; |
| 4 |
create table t1(a int not null primary key, b char(200)) engine=innodb; |
| 5 |
create table t2(a int not null primary key, b char(200)) engine=innodb row_format=compressed; |
| 6 |
create table t3(a int not null primary key, b char(200)) engine=innodb page_compressed=yes; |
| 7 |
create table t4(a int not null primary key, b char(200)) engine=innodb encrypted=yes; |
| 8 |
create table t5(a int not null primary key, b char(200)) engine=innodb encrypted=yes row_format=compressed; |
| 9 |
create table t6(a int not null primary key, b char(200)) engine=innodb encrypted=yes page_compressed=yes; |
| 10 |
create table t7(a int not null primary key, b char(200)) engine=innodb encrypted=no; |
| 11 |
create table t8(a int not null primary key, b char(200)) engine=innodb encrypted=no row_format=compressed; |
| 12 |
create table t9(a int not null primary key, b char(200)) engine=innodb encrypted=no page_compressed=yes; |
| 13 |
insert into t1 values (1, 'secredmessage'); |
| 14 |
insert into t2 values (1, 'secredmessage'); |
| 15 |
insert into t3 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc'); |
| 16 |
insert into t4 values (1, 'secredmessage'); |
| 17 |
insert into t5 values (1, 'secredmessage'); |
| 18 |
insert into t6 values (1, 'secredmessagecompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc'); |
| 19 |
insert into t7 values (1, 'publicmessage'); |
| 20 |
insert into t8 values (1, 'publicmessage'); |
| 21 |
insert into t9 values (1, 'pugliccompressedaaaaaaaaabbbbbbbbbbbbbbccccccccccccccc'); |
| 22 |
# should list tables t1-t6 |
| 23 |
SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 AND NAME LIKE 'enctests%'; |
| 24 |
NAME ENCRYPTION_SCHEME CURRENT_KEY_ID |
| 25 |
enctests/t1 1 1 |
| 26 |
enctests/t2 1 1 |
| 27 |
enctests/t3 1 1 |
| 28 |
enctests/t4 1 1 |
| 29 |
enctests/t5 1 1 |
| 30 |
enctests/t6 1 1 |
| 31 |
# should list tables t7-t9 |
| 32 |
SELECT NAME,ENCRYPTION_SCHEME,CURRENT_KEY_ID FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 and NAME LIKE 'enctests%'; |
| 33 |
NAME ENCRYPTION_SCHEME CURRENT_KEY_ID |
| 34 |
enctests/t7 0 1 |
| 35 |
enctests/t8 0 1 |
| 36 |
enctests/t9 0 1 |
| 37 |
# t1 default on expecting NOT FOUND |
| 38 |
NOT FOUND /secred/ in t1.ibd |
| 39 |
# t2 default on expecting NOT FOUND |
| 40 |
NOT FOUND /secred/ in t2.ibd |
| 41 |
# t3 default on expecting NOT FOUND |
| 42 |
NOT FOUND /secred/ in t3.ibd |
| 43 |
# t4 on expecting NOT FOUND |
| 44 |
NOT FOUND /secred/ in t4.ibd |
| 45 |
# t5 on expecting NOT FOUND |
| 46 |
NOT FOUND /secred/ in t5.ibd |
| 47 |
# t6 on expecting NOT FOUND |
| 48 |
NOT FOUND /secred/ in t6.ibd |
| 49 |
# t7 off expecting FOUND |
| 50 |
FOUND 1 /public/ in t7.ibd |
| 51 |
# t8 row compressed expecting NOT FOUND |
| 52 |
FOUND 1 /public/ in t8.ibd |
| 53 |
# t9 page compressed expecting NOT FOUND |
| 54 |
NOT FOUND /public/ in t9.ibd |
| 55 |
# restart |
| 56 |
drop database enctests; |