Debian Codegraph @

mysql-test/suite/innodb/t/innodb_buffer_pool_resize.test

raw
1 #
2 # WL6117 : Resize the InnoDB Buffer Pool Online
3 #
4
5 --source include/have_innodb_max_16k.inc
6 --source include/big_test.inc
7
8 let $wait_timeout = 180;
9 let $wait_condition =
10 SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at '
11 FROM performance_schema.global_status
12 WHERE LOWER(variable_name) = 'innodb_buffer_pool_resize_status';
13
14 --disable_query_log
15 set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size;
16 set @old_innodb_adaptive_hash_index = @@innodb_adaptive_hash_index;
17 --enable_query_log
18
19 set global innodb_adaptive_hash_index=ON;
20
21 select @@innodb_buffer_pool_size;
22
23 # Expand buffer pool
24 set global innodb_buffer_pool_size = 10485760;
25
26 --source include/wait_condition.inc
27
28 select @@innodb_buffer_pool_size;
29
30 # fill buffer pool
31 create table t1 (id int not null, val int not null default '0', primary key (id)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
32 create or replace view view0 as select 1 union all select 1;
33
34 set @`v_id` := 0;
35 set @`v_val` := 0;
36
37 # 2^18 == 262144 records
38 replace into t1 select (@`v_id` := (@`v_id` + 4) mod 4294967296) as id, (@`v_val` := (@`v_val` + 4) mod 4294967296) as val from view0 v0, view0 v1, view0 v2, view0 v3, view0 v4, view0 v5, view0 v6, view0 v7, view0 v8, view0 v9, view0 v10, view0 v11, view0 v12, view0 v13, view0 v14, view0 v15, view0 v16, view0 v17;
39
40 # Shrink buffer pool
41 set global innodb_buffer_pool_size = 7340032;
42 --source include/wait_condition.inc
43
44 select @@innodb_buffer_pool_size;
45
46 select count(val) from t1;
47
48 set global innodb_adaptive_hash_index=OFF;
49
50 # Expand buffer pool to 24MB
51 set global innodb_buffer_pool_size = 25165824;
52 --source include/wait_condition.inc
53
54 select @@innodb_buffer_pool_size;
55
56 select count(val) from t1;
57
58 drop table t1;
59 drop view view0;
60
61 --disable_query_log
62 set global innodb_adaptive_hash_index = @old_innodb_adaptive_hash_index;
63 set global innodb_buffer_pool_size = @old_innodb_buffer_pool_size;
64 --enable_query_log
65 --source include/wait_condition.inc