2012-08-14 17:23:34 +03:00
|
|
|
# Tests for PERFORMANCE_SCHEMA table io
|
2016-08-29 20:33:25 +03:00
|
|
|
# This test makes a restart because without it, events_waits_history_long
|
|
|
|
# sometimes contains duplicated entries of roles_mapping.
|
2012-08-14 17:23:34 +03:00
|
|
|
|
|
|
|
--source include/not_embedded.inc
|
|
|
|
--source include/have_perfschema.inc
|
2016-08-29 20:33:25 +03:00
|
|
|
--source include/restart_mysqld.inc
|
2012-08-14 17:23:34 +03:00
|
|
|
--source ../include/table_io_setup_helper.inc
|
|
|
|
|
|
|
|
# Remove "deleted" records from mysql.db that may come from previous tests,
|
|
|
|
# to avoid displaying spurious fetch.
|
|
|
|
# There are two possible server reactions which are both ok.
|
|
|
|
# Table Op Msg_type Msg_text
|
|
|
|
# mysql.db optimize status OK
|
|
|
|
# or
|
|
|
|
# mysql.db optimize status Table is already up to date
|
|
|
|
# Therefore we suppress the query_log here.
|
|
|
|
--echo # We are forced to suppress here the server response.
|
|
|
|
--disable_result_log
|
2013-07-08 15:19:50 +03:00
|
|
|
optimize table mysql.host;
|
|
|
|
optimize table mysql.user;
|
2012-08-14 17:23:34 +03:00
|
|
|
optimize table mysql.db;
|
2013-07-08 15:19:50 +03:00
|
|
|
optimize table mysql.proxies_priv;
|
|
|
|
optimize table mysql.tables_priv;
|
|
|
|
optimize table mysql.procs_priv;
|
|
|
|
optimize table mysql.servers;
|
2012-08-14 17:23:34 +03:00
|
|
|
--enable_result_log
|
|
|
|
|
|
|
|
# Start recording events
|
|
|
|
update performance_schema.setup_consumers set enabled='YES';
|
|
|
|
update performance_schema.setup_objects set enabled='YES'
|
|
|
|
where object_type='TABLE' and object_schema= 'mysql';
|
|
|
|
|
|
|
|
# Code to test
|
|
|
|
|
|
|
|
flush privileges;
|
|
|
|
# This will cause table io in mysql system security tables
|
|
|
|
insert into test.marker set a = 1;
|
|
|
|
# This will not, the ACL cache is already loaded
|
|
|
|
insert into test.marker set a = 1;
|
|
|
|
insert into test.marker set a = 1;
|
2015-05-04 22:16:00 +02:00
|
|
|
show variables where
|
|
|
|
`Variable_name` != "performance_schema_max_statement_classes" and
|
|
|
|
`Variable_name` like "performance_schema%";
|
2012-08-14 17:23:34 +03:00
|
|
|
show status like "performance_schema%";
|
|
|
|
# Stop recording events + pull results
|
|
|
|
let $schema_to_dump= "test", "mysql";
|
|
|
|
--source ../include/table_io_result_helper.inc
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
--source ../include/table_io_cleanup_helper.inc
|
|
|
|
|
|
|
|
update performance_schema.setup_objects set enabled='NO'
|
|
|
|
where object_type='TABLE' and object_schema= 'mysql';
|