~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb/t/innodb_buffer_pool_load.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#Want to skip this test from daily Valgrind execution
 
2
--source include/no_valgrind_without_big.inc
 
3
#
 
4
# Test for the functionality of InnoDB Buffer Pool dump/load.
 
5
#
 
6
 
 
7
-- source include/have_innodb.inc
 
8
# include/restart_mysqld.inc does not work in embedded mode
 
9
-- source include/not_embedded.inc
 
10
 
 
11
-- let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)`
 
12
 
 
13
-- error 0,1
 
14
-- remove_file $file
 
15
 
 
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)))
 
19
ENGINE=INNODB;
 
20
 
 
21
let $check_cnt =
 
22
SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru
 
23
WHERE table_name LIKE '%ib_bp_test%';
 
24
 
 
25
# See that we have a small number of pages in the LRU
 
26
-- eval $check_cnt
 
27
 
 
28
# Here we end up with 16382 rows in the table
 
29
-- disable_query_log
 
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));
 
32
let $i=12;
 
33
while ($i)
 
34
{
 
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;
 
37
  dec $i;
 
38
}
 
39
-- enable_query_log
 
40
 
 
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}
 
43
-- eval $check_cnt
 
44
 
 
45
# Dump
 
46
SET GLOBAL innodb_buffer_pool_dump_now = ON;
 
47
 
 
48
# Wait for the dump to complete
 
49
let $wait_condition =
 
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
 
54
 
 
55
# Confirm the file has been created
 
56
-- file_exists $file
 
57
 
 
58
# Add some garbage records to the dump file
 
59
-- let IBDUMPFILE = $file
 
60
perl;
 
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";
 
66
close($fh);
 
67
EOF
 
68
 
 
69
-- source include/restart_mysqld.inc
 
70
 
 
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;
 
73
 
 
74
# Load
 
75
SET GLOBAL innodb_buffer_pool_load_now = ON;
 
76
 
 
77
# Wait for the load to complete
 
78
let $wait_condition =
 
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
 
83
 
 
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/
 
86
SELECT variable_value
 
87
FROM information_schema.global_status
 
88
WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status';
 
89
 
 
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}
 
92
-- eval $check_cnt
 
93
 
 
94
# Add some total garbage to the dump file
 
95
-- let IBDUMPFILE = $file
 
96
perl;
 
97
my $fn = $ENV{'IBDUMPFILE'};
 
98
open(my $fh, '>>', $fn) || die "perl open($fn): $!";
 
99
print $fh "abcdefg\n";
 
100
close($fh);
 
101
EOF
 
102
 
 
103
call mtr.add_suppression("InnoDB: Error parsing");
 
104
 
 
105
# Load
 
106
SET GLOBAL innodb_buffer_pool_load_now = ON;
 
107
 
 
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
 
114
 
 
115
DROP TABLE ib_bp_test;