| 1 |
# Tests for PERFORMANCE_SCHEMA table io |
| 2 |
# This test makes a restart because without it, events_waits_history_long |
| 3 |
# sometimes contains duplicated entries of roles_mapping. |
| 4 |
|
| 5 |
--source include/not_embedded.inc |
| 6 |
--source include/hostname_is_not_localhost.inc |
| 7 |
--source include/have_perfschema.inc |
| 8 |
--source include/restart_mysqld.inc |
| 9 |
--source ../include/table_io_setup_helper.inc |
| 10 |
|
| 11 |
# Remove "deleted" records from mysql.db that may come from previous tests, |
| 12 |
# to avoid displaying spurious fetch. |
| 13 |
# There are two possible server reactions which are both ok. |
| 14 |
# Table Op Msg_type Msg_text |
| 15 |
# mysql.db optimize status OK |
| 16 |
# or |
| 17 |
# mysql.db optimize status Table is already up to date |
| 18 |
# Therefore we suppress the query_log here. |
| 19 |
--echo # We are forced to suppress here the server response. |
| 20 |
--disable_result_log |
| 21 |
optimize table mysql.user; |
| 22 |
optimize table mysql.db; |
| 23 |
optimize table mysql.proxies_priv; |
| 24 |
optimize table mysql.roles_mapping; |
| 25 |
optimize table mysql.tables_priv; |
| 26 |
optimize table mysql.procs_priv; |
| 27 |
optimize table mysql.servers; |
| 28 |
optimize table mysql.roles_mapping; |
| 29 |
--enable_result_log |
| 30 |
|
| 31 |
# Start recording events |
| 32 |
update performance_schema.setup_consumers set enabled='YES'; |
| 33 |
update performance_schema.setup_objects set enabled='YES' |
| 34 |
where object_type='TABLE' and object_schema= 'mysql'; |
| 35 |
|
| 36 |
# Code to test |
| 37 |
|
| 38 |
flush privileges; |
| 39 |
# This will cause table io in mysql system security tables |
| 40 |
insert into test.marker set a = 1; |
| 41 |
# This will not, the ACL cache is already loaded |
| 42 |
insert into test.marker set a = 1; |
| 43 |
insert into test.marker set a = 1; |
| 44 |
show global variables like "performance_schema%"; |
| 45 |
show global status like "performance_schema%"; |
| 46 |
# Stop recording events + pull results |
| 47 |
let $schema_to_dump= "test", "mysql"; |
| 48 |
--source ../include/table_io_result_helper.inc |
| 49 |
|
| 50 |
# Cleanup |
| 51 |
--source ../include/table_io_cleanup_helper.inc |
| 52 |
|
| 53 |
update performance_schema.setup_objects set enabled='NO' |
| 54 |
where object_type='TABLE' and object_schema= 'mysql'; |