summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/innodb-trim.test
blob: 0f38ea5ba84c010bddc42708acc483ab6f845e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--source include/have_innodb.inc
--source include/have_innodb_punchhole.inc

--disable_query_log
--disable_warnings
let $innodb_compression_algorithm_orig=`SELECT @@innodb_compression_algorithm`;
--enable_warnings
--enable_query_log

# zlib
set global innodb_compression_algorithm = 1;

create table innodb_page_compressed (c1 int not null primary key auto_increment, b char(200), c char(200), d char(200)) engine=innodb page_compressed=1 page_compression_level=9;
show warnings;

delimiter //;
create procedure innodb_insert_proc (repeat_count int)
begin
  declare current_num int;
  set current_num = 0;
  while current_num < repeat_count do
    insert into innodb_page_compressed values (NULL,repeat('A',150),repeat('AB',75),repeat('B', 175));
    set current_num = current_num + 1;
  end while;
end//
delimiter ;//
commit;

set autocommit=0;
call innodb_insert_proc(16000);
commit;
set autocommit=1;


let $success= `SELECT variable_value FROM information_schema.global_status WHERE variable_name = 'innodb_num_page_compressed_trim_op'`;

if (!$success) {
--disable_query_log
--disable_result_log
    DROP PROCEDURE innodb_insert_proc;
    DROP TABLE innodb_page_compressed;
--enable_query_log
--enable_result_log
    --skip "Test requires TRIM";
}

DROP PROCEDURE innodb_insert_proc;
DROP TABLE innodb_page_compressed;

--disable_query_log
--disable_warnings
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algorithm_orig;
--enable_warnings
--enable_query_log