| 1 |
# Tests for PERFORMANCE_SCHEMA table io |
| 2 |
|
| 3 |
--source ../include/table_io_setup_helper.inc |
| 4 |
|
| 5 |
# Remove "deleted" records from mysql.* that may come from previous tests, |
| 6 |
# to avoid displaying spurious fetch. |
| 7 |
# There are two possible server reactions which are both ok. |
| 8 |
# Table Op Msg_type Msg_text |
| 9 |
# mysql.db optimize status OK |
| 10 |
# or |
| 11 |
# mysql.db optimize status Table is already up to date |
| 12 |
# Therefore we suppress the query_log here. |
| 13 |
--echo # We are forced to suppress here the server response. |
| 14 |
--disable_result_log |
| 15 |
optimize table mysql.host; |
| 16 |
optimize table mysql.user; |
| 17 |
optimize table mysql.db; |
| 18 |
optimize table mysql.proxies_priv; |
| 19 |
optimize table mysql.tables_priv; |
| 20 |
optimize table mysql.procs_priv; |
| 21 |
optimize table mysql.servers; |
| 22 |
|
| 23 |
# Execute 'flush privileges' one time before recording so that |
| 24 |
# fetch from dictionary tables does not pollute the result. |
| 25 |
flush privileges; |
| 26 |
|
| 27 |
# Execute show statements to make sure the corresponding |
| 28 |
# dd::Table objects are acquired and present in the dictionary |
| 29 |
# cache. This is necessary to avoid nondeterminism due to |
| 30 |
# the caching behavior. |
| 31 |
|
| 32 |
show create table test.marker; |
| 33 |
show global status; |
| 34 |
show global variables; |
| 35 |
|
| 36 |
--enable_result_log |
| 37 |
|
| 38 |
# Start recording events |
| 39 |
update performance_schema.setup_consumers set enabled='YES'; |
| 40 |
update performance_schema.setup_objects set enabled='YES' |
| 41 |
where object_type='TABLE' and object_schema= 'mysql'; |
| 42 |
|
| 43 |
# Code to test |
| 44 |
|
| 45 |
flush privileges; |
| 46 |
# This will cause table io in mysql system security tables |
| 47 |
insert into test.marker set a = 1; |
| 48 |
# This will not, the ACL cache is already loaded |
| 49 |
insert into test.marker set a = 1; |
| 50 |
insert into test.marker set a = 1; |
| 51 |
show global variables like "performance_schema%table%"; |
| 52 |
show global status like "performance_schema%table%"; |
| 53 |
# Stop recording events + pull results |
| 54 |
let $schema_to_dump= "test", "mysql"; |
| 55 |
--source ../include/table_io_result_helper.inc |
| 56 |
|
| 57 |
# Cleanup |
| 58 |
--source ../include/table_io_cleanup_helper.inc |
| 59 |
|
| 60 |
update performance_schema.setup_objects set enabled='NO' |
| 61 |
where object_type='TABLE' and object_schema= 'mysql'; |