Debian Codegraph @

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

raw
1 # Exercise the code path for INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS
2 # and INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
3
4 # This test assumes that buffer pool is idle
5 # with key rotation threads buffer pages gets evicted this
6 # testcase gets flaky
7 -- source include/not_encrypted.inc
8
9 -- source include/have_innodb.inc
10
11 --replace_regex /([0-9]*\.)?[0-9]+/#/
12 SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS;
13
14 # Create a table and check its page info behave correctly in the pool
15 CREATE TABLE infoschema_buffer_test (col1 INT) ENGINE = INNODB;
16
17 INSERT INTO infoschema_buffer_test VALUES(9);
18
19 # We should be able to see this table in the buffer pool if we check
20 # right away
21 --sorted_result
22 --replace_column 2 # 3 # 7 FIX 8 AHI 9 LSN 10 LSN 11 TIME 18 IO_FIX 19 OLD 20 #
23 SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
24 WHERE TABLE_NAME LIKE '%infoschema_buffer_test%' AND PAGE_TYPE='index';
25
26 # The NUMBER_RECORDS and DATA_SIZE should check with each insertion
27 INSERT INTO infoschema_buffer_test VALUES(19);
28
29 CREATE INDEX idx ON infoschema_buffer_test(col1);
30
31 --sorted_result
32 --replace_column 2 # 3 # 7 FIX 8 AHI 9 LSN 10 LSN 11 TIME 18 IO_FIX 19 OLD 20 #
33 SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
34 WHERE TABLE_NAME LIKE '%infoschema_buffer_test%' AND PAGE_TYPE='index';
35
36 # Check the buffer after dropping the table
37 DROP TABLE infoschema_buffer_test;
38
39 SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
40 WHERE TABLE_NAME LIKE '%infoschema_buffer_test%';
41
42 CREATE TABLE infoschema_parent (id INT NOT NULL, PRIMARY KEY (id))
43 ENGINE=INNODB;
44
45 CREATE TABLE infoschema_child (id INT, parent_id INT, INDEX par_ind (parent_id),
46 FOREIGN KEY (parent_id)
47 REFERENCES infoschema_parent(id)
48 ON DELETE CASCADE)
49 ENGINE=INNODB;
50
51 --sorted_result
52 --replace_column 2 # 3 # 7 FIX 8 AHI 9 LSN 10 LSN 11 TIME 18 IO_FIX 19 OLD 20 #
53 SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE
54 WHERE TABLE_NAME LIKE '%infoschema_child%';
55
56 DROP TABLE infoschema_child;
57 DROP TABLE infoschema_parent;