Current Path : /usr/opt/mysql57/mysql-test/suite/innodb/t/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/mysql57/mysql-test/suite/innodb/t/innodb_information_schema_buffer.test |
# Exercise the code path for INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS # and INFORMATION_SCHEMA.INNODB_BUFFER_PAGE -- source include/have_innodb.inc -- disable_result_log SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS; # How many buffer pools we have SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_POOL_STATS; SELECT * FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE; # This gives the over all buffer pool size SELECT COUNT(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE; -- enable_result_log # Create a table and check its page info behave correctly in the pool CREATE TABLE infoschema_buffer_test (col1 INT) ENGINE = INNODB; INSERT INTO infoschema_buffer_test VALUES(9); # We should be able to see this table in the buffer pool if we check # right away SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE WHERE TABLE_NAME like "%infoschema_buffer_test%" and PAGE_STATE="file_page" and PAGE_TYPE="index"; # The NUMBER_RECORDS and DATA_SIZE should check with each insertion INSERT INTO infoschema_buffer_test VALUES(19); SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE WHERE TABLE_NAME like "%infoschema_buffer_test%" and PAGE_STATE="file_page" and PAGE_TYPE="index"; CREATE INDEX idx ON infoschema_buffer_test(col1); SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE WHERE TABLE_NAME like "%infoschema_buffer_test%" and PAGE_STATE="file_page" and INDEX_NAME = "idx" and PAGE_TYPE="index"; # Check the buffer after dropping the table DROP TABLE infoschema_buffer_test; SELECT TABLE_NAME, INDEX_NAME, NUMBER_RECORDS, DATA_SIZE, PAGE_STATE, PAGE_TYPE FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE WHERE TABLE_NAME like "%infoschema_buffer_test%"; # Do one more test #--replace_regex /'*[0-9]*'/'NUM'/ CREATE TABLE infoschema_parent (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; CREATE TABLE infoschema_child (id INT, parent_id INT, INDEX par_ind (parent_id), FOREIGN KEY (parent_id) REFERENCES infoschema_parent(id) ON DELETE CASCADE) ENGINE=INNODB; SELECT count(*) FROM INFORMATION_SCHEMA.INNODB_BUFFER_PAGE WHERE TABLE_NAME like "%infoschema_child%" and PAGE_STATE="file_page" and PAGE_TYPE="index"; DROP TABLE infoschema_child; DROP TABLE infoschema_parent;