|
| 1 | +-- source include/have_innodb.inc |
| 2 | +-- source include/have_example_key_management_plugin.inc |
| 3 | + |
| 4 | +# embedded does not support restart |
| 5 | +-- source include/not_embedded.inc |
| 6 | + |
| 7 | +--disable_query_log |
| 8 | +let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`; |
| 9 | +let $innodb_file_format_orig = `SELECT @@innodb_file_format`; |
| 10 | +let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; |
| 11 | +--enable_query_log |
| 12 | + |
| 13 | +SET GLOBAL innodb_file_format = `Barracuda`; |
| 14 | +SET GLOBAL innodb_file_per_table = ON; |
| 15 | +# zlib |
| 16 | +set global innodb_compression_algorithm = 1; |
| 17 | + |
| 18 | +create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb page_compressed=1; |
| 19 | +create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact page_compressed=1; |
| 20 | +create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic page_compressed=1; |
| 21 | +show warnings; |
| 22 | + |
| 23 | +show create table innodb_normal; |
| 24 | +show create table innodb_compact; |
| 25 | +show create table innodb_dynamic; |
| 26 | + |
| 27 | +delimiter //; |
| 28 | +create procedure innodb_insert_proc (repeat_count int) |
| 29 | +begin |
| 30 | + declare current_num int; |
| 31 | + set current_num = 0; |
| 32 | + while current_num < repeat_count do |
| 33 | + insert into innodb_normal values(current_num, substring(MD5(RAND()), -64)); |
| 34 | + set current_num = current_num + 1; |
| 35 | + end while; |
| 36 | +end// |
| 37 | +delimiter ;// |
| 38 | +commit; |
| 39 | + |
| 40 | +set autocommit=0; |
| 41 | +call innodb_insert_proc(5000); |
| 42 | +commit; |
| 43 | +set autocommit=1; |
| 44 | + |
| 45 | +insert into innodb_compact select * from innodb_normal; |
| 46 | +insert into innodb_dynamic select * from innodb_normal; |
| 47 | + |
| 48 | +update innodb_normal set c1 = c1 + 1; |
| 49 | +update innodb_compact set c1 = c1 + 1; |
| 50 | +update innodb_dynamic set c1 = c1 + 1; |
| 51 | +select count(*) from innodb_normal; |
| 52 | +select count(*) from innodb_compact where c1 < 1500000; |
| 53 | +select count(*) from innodb_dynamic where c1 < 1500000; |
| 54 | + |
| 55 | +SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted'; |
| 56 | +SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted'; |
| 57 | +SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error'; |
| 58 | +SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed'; |
| 59 | +SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed'; |
| 60 | + |
| 61 | +--source include/restart_mysqld.inc |
| 62 | + |
| 63 | +SET GLOBAL innodb_file_format = `Barracuda`; |
| 64 | +SET GLOBAL innodb_file_per_table = ON; |
| 65 | +# zlib |
| 66 | +set global innodb_compression_algorithm = 1; |
| 67 | + |
| 68 | +update innodb_normal set c1 = c1 + 1; |
| 69 | +update innodb_compact set c1 = c1 + 1; |
| 70 | +update innodb_dynamic set c1 = c1 + 1; |
| 71 | +select count(*) from innodb_normal; |
| 72 | +select count(*) from innodb_compact where c1 < 1500000; |
| 73 | +select count(*) from innodb_dynamic where c1 < 1500000; |
| 74 | + |
| 75 | +SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted'; |
| 76 | +SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted'; |
| 77 | +SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error'; |
| 78 | +SELECT variable_value > 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed'; |
| 79 | +SELECT variable_value > 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed'; |
| 80 | + |
| 81 | +alter table innodb_normal engine=innodb page_compressed=DEFAULT; |
| 82 | +show create table innodb_normal; |
| 83 | +alter table innodb_compact engine=innodb page_compressed=DEFAULT; |
| 84 | +show create table innodb_compact; |
| 85 | +alter table innodb_dynamic engine=innodb page_compressed=DEFAULT; |
| 86 | +show create table innodb_dynamic; |
| 87 | + |
| 88 | +--source include/restart_mysqld.inc |
| 89 | + |
| 90 | +SET GLOBAL innodb_file_format = `Barracuda`; |
| 91 | +SET GLOBAL innodb_file_per_table = ON; |
| 92 | + |
| 93 | +show create table innodb_normal; |
| 94 | +show create table innodb_compact; |
| 95 | +show create table innodb_dynamic; |
| 96 | + |
| 97 | +update innodb_normal set c1 = c1 + 1; |
| 98 | +update innodb_compact set c1 = c1 + 1; |
| 99 | +update innodb_dynamic set c1 = c1 + 1; |
| 100 | +select count(*) from innodb_normal; |
| 101 | +select count(*) from innodb_compact where c1 < 1500000; |
| 102 | +select count(*) from innodb_dynamic where c1 < 1500000; |
| 103 | + |
| 104 | +SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encrypted'; |
| 105 | +SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decrypted'; |
| 106 | +SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_encryption_error'; |
| 107 | +SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_compressed'; |
| 108 | +SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_page_decompressed'; |
| 109 | + |
| 110 | +drop procedure innodb_insert_proc; |
| 111 | +drop table innodb_normal; |
| 112 | +drop table innodb_compact; |
| 113 | +drop table innodb_dynamic; |
| 114 | + |
| 115 | +# reset system |
| 116 | +--disable_query_log |
| 117 | +EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig; |
| 118 | +EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig; |
| 119 | +EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig; |
| 120 | +--enable_query_log |
0 commit comments