Debian Codegraph @

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

raw
1 # ************************************************************
2 # wl6504: This testcase is to check the functionality of the
3 # innodb_buffer_pool_dump_pct flag
4 # step 1.Set innodb_buffer_pool_dump_pct=100 and take the dump
5 # step 2.Set innodb_buffer_pool_dump_pct=1 and take the dump
6 # step 3.Compare the size of both the dump files
7 #*************************************************************
8 --source include/have_innodb.inc
9 --source include/have_innodb_16k.inc
10
11 let MYSQLD_DATADIR = `SELECT @@datadir`;
12
13 CREATE TABLE tab5 (col1 int auto_increment primary key,
14 col2 VARCHAR(25), col3 varchar(25)) ENGINE=InnoDB;
15 CREATE INDEX idx1 ON tab5(col2(10));
16 CREATE INDEX idx2 ON tab5(col3(10));
17
18 SET GLOBAL innodb_buffer_pool_dump_pct=100;
19
20 #***********************************************************
21 # SELECT *
22 # FROM information_schema.global_status
23 # WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'
24 # gives
25 # a) VARIABLE_NAME VARIABLE_VALUE
26 # INNODB_BUFFER_POOL_DUMP_STATUS not started
27 # in case there was no innodb_buffer_pool_dump since server start.
28 # b) Something like
29 # VARIABLE_NAME VARIABLE_VALUE
30 # INNODB_BUFFER_POOL_DUMP_STATUS Buffer pool(s) dump completed at 130711 13:43:24
31 # in case there was a innodb_buffer_pool_dump since server start.
32 # Attention:
33 # - There is no guarantee that the current test is the first test which
34 # made an innodb_buffer_pool_dump since server startup.
35 # - The granularity of the timestamp is one second.
36 # - There could have been some dump caused by some previous test
37 # just a few milliseconds before.
38 #***********************************************************
39
40 --error 0,1
41 --remove_file $MYSQLD_DATADIR/ib_buffer_pool
42
43 SET GLOBAL innodb_buffer_pool_dump_now=ON;
44 perl;
45 my $f="$ENV{MYSQLD_DATADIR}/ib_buffer_pool";
46 my $count=300;
47 until (-e $f)
48 {
49 select(undef, undef, undef, .1);
50 die "File $f was not created\n" if (0 > --$count);
51 }
52 EOF
53 let $wait_condition = SELECT count(*) = 1
54 FROM information_schema.global_status
55 WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'
56 AND variable_value like 'Buffer pool(s) dump completed at%';
57 --source include/wait_condition.inc
58
59 --move_file $MYSQLD_DATADIR/ib_buffer_pool $MYSQLD_DATADIR/ib_buffer_pool100
60 SET GLOBAL innodb_buffer_pool_dump_pct=1;
61 SET GLOBAL innodb_buffer_pool_dump_now=ON;
62
63 perl;
64 my $f="$ENV{MYSQLD_DATADIR}/ib_buffer_pool";
65 my $count=300;
66 until (-e $f)
67 {
68 select(undef, undef, undef, .1);
69 die "File $f was not created\n" if (0 > --$count);
70 }
71 EOF
72
73 let $wait_condition = SELECT count(*) = 1
74 FROM information_schema.global_status
75 WHERE variable_name = 'INNODB_BUFFER_POOL_DUMP_STATUS'
76 AND variable_value like 'Buffer pool(s) dump completed at%';
77 --source include/wait_condition.inc
78
79 --file_exists $MYSQLD_DATADIR/ib_buffer_pool
80
81 perl;
82 my $size1 = -s "$ENV{MYSQLD_DATADIR}/ib_buffer_pool";
83 my $size100 = -s "$ENV{MYSQLD_DATADIR}/ib_buffer_pool100";
84 die "$size100<=$size1\n" unless $size100 > $size1;
85 EOF
86
87 SET GLOBAL innodb_buffer_pool_dump_pct=DEFAULT;
88
89 --remove_file $MYSQLD_DATADIR/ib_buffer_pool100
90 DROP TABLE tab5;