| 1 |
-- source include/have_innodb.inc |
| 2 |
-- source include/not_embedded.inc |
| 3 |
-- source include/have_file_key_management_plugin.inc |
| 4 |
|
| 5 |
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; |
| 6 |
|
| 7 |
# zlib |
| 8 |
set global innodb_compression_algorithm = 1; |
| 9 |
|
| 10 |
create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1; |
| 11 |
show warnings; |
| 12 |
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; |
| 13 |
show warnings; |
| 14 |
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; |
| 15 |
show warnings; |
| 16 |
|
| 17 |
show create table innodb_normal; |
| 18 |
show create table innodb_compact; |
| 19 |
show create table innodb_dynamic; |
| 20 |
|
| 21 |
delimiter //; |
| 22 |
create procedure innodb_insert_proc (repeat_count int) |
| 23 |
begin |
| 24 |
declare current_num int; |
| 25 |
set current_num = 0; |
| 26 |
while current_num < repeat_count do |
| 27 |
insert into innodb_normal values(current_num, substring(MD5(RAND()), -128)); |
| 28 |
set current_num = current_num + 1; |
| 29 |
end while; |
| 30 |
end// |
| 31 |
delimiter ;// |
| 32 |
commit; |
| 33 |
|
| 34 |
begin; |
| 35 |
call innodb_insert_proc(2000); |
| 36 |
insert into innodb_compact select * from innodb_normal; |
| 37 |
insert into innodb_dynamic select * from innodb_normal; |
| 38 |
commit; |
| 39 |
|
| 40 |
FLUSH TABLES innodb_compact FOR EXPORT; UNLOCK TABLES; |
| 41 |
FLUSH TABLES innodb_dynamic FOR EXPORT; UNLOCK TABLES; |
| 42 |
select variable_value > 0 from information_schema.global_status |
| 43 |
where variable_name = 'INNODB_NUM_PAGES_PAGE_COMPRESSED'; |
| 44 |
|
| 45 |
--let $restart_parameters=--innodb-encrypt-tables=OFF |
| 46 |
--source include/restart_mysqld.inc |
| 47 |
|
| 48 |
# zlib |
| 49 |
set global innodb_compression_algorithm = 1; |
| 50 |
|
| 51 |
alter table innodb_normal engine=innodb page_compressed=DEFAULT; |
| 52 |
show create table innodb_normal; |
| 53 |
alter table innodb_compact engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT; |
| 54 |
show create table innodb_compact; |
| 55 |
alter table innodb_dynamic engine=innodb encrypted=DEFAULT encryption_key_id=DEFAULT page_compressed=DEFAULT; |
| 56 |
show create table innodb_dynamic; |
| 57 |
|
| 58 |
FLUSH TABLES innodb_normal FOR EXPORT; UNLOCK TABLES; |
| 59 |
FLUSH TABLES innodb_compact FOR EXPORT; UNLOCK TABLES; |
| 60 |
FLUSH TABLES innodb_dynamic FOR EXPORT; UNLOCK TABLES; |
| 61 |
|
| 62 |
select variable_value > 0 from information_schema.global_status |
| 63 |
where variable_name = 'INNODB_NUM_PAGES_PAGE_DECOMPRESSED'; |
| 64 |
|
| 65 |
drop procedure innodb_insert_proc; |
| 66 |
drop table innodb_normal; |
| 67 |
drop table innodb_compact; |
| 68 |
drop table innodb_dynamic; |
| 69 |
|
| 70 |
# reset system |
| 71 |
--disable_query_log |
| 72 |
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; |
| 73 |
--enable_query_log |