1-- source include/have_innodb.inc
2#-- source include/have_example_key_management_plugin.inc
3-- source include/not_embedded.inc
4
5create table innodb_normal(c1 bigint not null, b char(200)) engine=innodb;
6create table innodb_compact(c1 bigint not null, b char(200)) engine=innodb row_format=compact;
7create table innodb_dynamic(c1 bigint not null, b char(200)) engine=innodb row_format=dynamic;
8create table innodb_compressed(c1 bigint not null, b char(200)) engine=innodb row_format=compressed;
9create table innodb_redundant(c1 bigint not null, b char(200)) engine=innodb row_format=redundant;
10
11show warnings;
12
13show create table innodb_normal;
14show create table innodb_compact;
15show create table innodb_dynamic;
16show create table innodb_compressed;
17show create table innodb_redundant;
18
19delimiter //;
20create procedure innodb_insert_proc (repeat_count int)
21begin
22  declare current_num int;
23  set current_num = 0;
24  while current_num < repeat_count do
25    insert into innodb_normal values(current_num, substring(MD5(RAND()), -64));
26    set current_num = current_num + 1;
27  end while;
28end//
29delimiter ;//
30commit;
31
32set autocommit=0;
33call innodb_insert_proc(2000);
34commit;
35set autocommit=1;
36
37insert into innodb_compact select * from innodb_normal;
38insert into innodb_dynamic select * from innodb_normal;
39insert into innodb_compressed select * from innodb_normal;
40insert into innodb_redundant select * from innodb_normal;
41
42update innodb_normal set c1 = c1 + 1;
43update innodb_compact set c1 = c1 + 1;
44update innodb_dynamic set c1 = c1 + 1;
45update innodb_compressed set c1 = c1 + 1;
46update innodb_redundant set c1 = c1 + 1;
47select count(*) from innodb_normal;
48select count(*) from innodb_compact where c1 < 1500000;
49select count(*) from innodb_dynamic where c1 < 1500000;
50select count(*) from innodb_compressed where c1 < 1500000;
51select count(*) from innodb_redundant where c1 < 1500000;
52select count(*) from innodb_compact t1, innodb_normal t2 where
53t1.c1 = t2.c1 and t1.b = t2.b;
54select count(*) from innodb_dynamic t1, innodb_normal t2 where
55t1.c1 = t2.c1 and t1.b = t2.b;
56select count(*) from innodb_compressed t1, innodb_normal t2 where
57t1.c1 = t2.c1 and t1.b = t2.b;
58select count(*) from innodb_redundant t1, innodb_normal t2 where
59t1.c1 = t2.c1 and t1.b = t2.b;
60
61SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
62SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
63SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
64SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
65
66--source include/restart_mysqld.inc
67
68update innodb_normal set c1 = c1 + 1;
69update innodb_compact set c1 = c1 + 1;
70update innodb_dynamic set c1 = c1 + 1;
71update innodb_compressed set c1 = c1 + 1;
72update innodb_redundant set c1 = c1 + 1;
73select count(*) from innodb_normal;
74select count(*) from innodb_compact where c1 < 1500000;
75select count(*) from innodb_dynamic where c1 < 1500000;
76select count(*) from innodb_compressed where c1 < 1500000;
77select count(*) from innodb_redundant where c1 < 1500000;
78select count(*) from innodb_compact t1, innodb_normal t2 where
79t1.c1 = t2.c1 and t1.b = t2.b;
80select count(*) from innodb_dynamic t1, innodb_normal t2 where
81t1.c1 = t2.c1 and t1.b = t2.b;
82select count(*) from innodb_compressed t1, innodb_normal t2 where
83t1.c1 = t2.c1 and t1.b = t2.b;
84select count(*) from innodb_redundant t1, innodb_normal t2 where
85t1.c1 = t2.c1 and t1.b = t2.b;
86
87SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_encrypted';
88SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decrypted';
89SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_compressed';
90SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_page_decompressed';
91
92drop procedure innodb_insert_proc;
93drop table innodb_normal;
94drop table innodb_compact;
95drop table innodb_dynamic;
96drop table innodb_compressed;
97drop table innodb_redundant;
98