| 1 |
# Tests for PERFORMANCE_SCHEMA |
| 2 |
|
| 3 |
--source ../include/start_server_common.inc |
| 4 |
|
| 5 |
select * from information_schema.engines |
| 6 |
where engine = "PERFORMANCE_SCHEMA"; |
| 7 |
|
| 8 |
# Expecting all off / zero |
| 9 |
show global status like "performance_schema%_lost"; |
| 10 |
|
| 11 |
# Expect all consumers disabled |
| 12 |
|
| 13 |
select * from performance_schema.setup_consumers; |
| 14 |
|
| 15 |
# Expect no instruments |
| 16 |
|
| 17 |
select * from performance_schema.setup_instruments; |
| 18 |
|
| 19 |
select * from performance_schema.setup_actors; |
| 20 |
select * from performance_schema.setup_objects; |
| 21 |
|
| 22 |
# Expect INSERT to fail with an error |
| 23 |
|
| 24 |
--error ER_WRONG_PERFSCHEMA_USAGE |
| 25 |
insert into performance_schema.setup_objects values ('TABLE', 'myschema', 'myobject', 'YES', 'YES'); |
| 26 |
|
| 27 |
--error ER_WRONG_PERFSCHEMA_USAGE |
| 28 |
insert into performance_schema.setup_actors values ('myhost', 'mysuser', 'myrole', 'YES', 'YES'); |
| 29 |
|
| 30 |
# Expect SELECT, UPDATE, DELETE and TRUNCATE to affect 0 rows, but with |
| 31 |
# no error because the target row(s) will not be found |
| 32 |
|
| 33 |
select * from performance_schema.setup_objects; |
| 34 |
update performance_schema.setup_objects set OBJECT_NAME = 'myobject'; |
| 35 |
delete from performance_schema.setup_objects; |
| 36 |
|
| 37 |
select * from performance_schema.setup_actors; |
| 38 |
update performance_schema.setup_actors set HOST = 'myhost'; |
| 39 |
delete from performance_schema.setup_actors; |
| 40 |
|
| 41 |
truncate performance_schema.events_stages_history_long; |
| 42 |
truncate performance_schema.events_statements_history_long; |
| 43 |
truncate performance_schema.events_waits_history_long; |
| 44 |
truncate performance_schema.setup_objects; |
| 45 |
truncate performance_schema.setup_actors; |
| 46 |
|
| 47 |
# |
| 48 |
# Verify SHOW STATUS and SHOW VARIABLES |
| 49 |
# |
| 50 |
|
| 51 |
# Expect that status variables are still accessible |
| 52 |
show global status like "performance_schema%_lost"; |
| 53 |
show session status like "performance_schema%_lost"; |
| 54 |
|
| 55 |
# Expect that system variables are still accessible |
| 56 |
show global variables like "performance_schema"; |
| 57 |
show session variables like "performance_schema"; |
| 58 |
|