1
#Want to skip this test from daily Valgrind execution
2
--source include/no_valgrind_without_big.inc
4
# Test for the functionality of InnoDB Buffer Pool dump/load.
7
-- source include/have_innodb.inc
8
# include/restart_mysqld.inc does not work in embedded mode
9
-- source include/not_embedded.inc
11
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
16
# Create a table and populate it with some data
17
CREATE TABLE ib_bp_test
18
(a INT AUTO_INCREMENT, b VARCHAR(64), c TEXT, PRIMARY KEY (a), KEY (b, c(128)))
22
SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
23
WHERE table_name LIKE '%ib_bp_test%';
25
# See that we have a small number of pages in the LRU
28
# Here we end up with 16382 rows in the table
30
INSERT INTO ib_bp_test (b, c) VALUES (REPEAT('b', 64), REPEAT('c', 256));
31
INSERT INTO ib_bp_test (b, c) VALUES (REPEAT('B', 64), REPEAT('C', 256));
35
-- eval INSERT INTO ib_bp_test (b, c) VALUES ($i, $i * $i);
36
INSERT INTO ib_bp_test (b, c) SELECT b, c FROM ib_bp_test;
41
# Accept 329 for 16k page size, 662 for 8k page size & 1392 for 4k page size
42
-- replace_result 329 {checked_valid} 662 {checked_valid} 1392 {checked_valid}
46
SET GLOBAL innodb_buffer_pool_dump_now = ON;
48
# Wait for the dump to complete
50
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at '
51
FROM information_schema.global_status
52
WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status';
53
-- source include/wait_condition.inc
55
# Confirm the file has been created
58
# Add some garbage records to the dump file
59
-- let IBDUMPFILE = $file
61
my $fn = $ENV{'IBDUMPFILE'};
62
open(my $fh, '>>', $fn) || die "perl open($fn): $!";
63
print $fh "123456,0\n";
64
print $fh "0,123456\n";
65
print $fh "123456,123456\n";
69
-- source include/restart_mysqld.inc
71
# Load the table so that entries in the I_S table do not appear as NULL
72
select count(*) from ib_bp_test where a = 1;
75
SET GLOBAL innodb_buffer_pool_load_now = ON;
77
# Wait for the load to complete
79
SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at '
80
FROM information_schema.global_status
81
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
82
-- source include/wait_condition.inc
84
# Show the status, interesting if the above timed out
85
-- replace_regex /[0-9]{6}[[:space:]]+[0-9]{1,2}:[0-9]{2}:[0-9]{2}/TIMESTAMP_NOW/
87
FROM information_schema.global_status
88
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
90
# Accept 329 for 16k page size, 662 for 8k page size & 1392 for 4k page size
91
-- replace_result 329 {checked_valid} 662 {checked_valid} 1392 {checked_valid}
94
# Add some total garbage to the dump file
95
-- let IBDUMPFILE = $file
97
my $fn = $ENV{'IBDUMPFILE'};
98
open(my $fh, '>>', $fn) || die "perl open($fn): $!";
99
print $fh "abcdefg\n";
103
call mtr.add_suppression("InnoDB: Error parsing");
106
SET GLOBAL innodb_buffer_pool_load_now = ON;
108
# Wait for the load to fail
109
let $wait_condition =
110
SELECT SUBSTR(variable_value, 1, 13) = 'Error parsing'
111
FROM information_schema.global_status
112
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
113
-- source include/wait_condition.inc
115
DROP TABLE ib_bp_test;