| 1 |
# Tests for PERFORMANCE_SCHEMA |
| 2 |
|
| 3 |
--source include/not_embedded.inc |
| 4 |
--source include/have_perfschema.inc |
| 5 |
|
| 6 |
|
| 7 |
# Setup : in this main thread |
| 8 |
|
| 9 |
update performance_schema.setup_instruments set enabled='NO'; |
| 10 |
update performance_schema.setup_consumers set enabled='YES'; |
| 11 |
update performance_schema.setup_instruments set enabled='YES' |
| 12 |
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam"; |
| 13 |
|
| 14 |
--disable_warnings |
| 15 |
drop table if exists test.t1; |
| 16 |
--enable_warnings |
| 17 |
|
| 18 |
truncate table performance_schema.events_waits_current; |
| 19 |
truncate table performance_schema.events_waits_history; |
| 20 |
truncate table performance_schema.events_waits_history_long; |
| 21 |
|
| 22 |
show global variables like "thread_handling"; |
| 23 |
|
| 24 |
# Make sure no thread instrumentation is lost |
| 25 |
show status like "Performance_schema_thread_instances_lost"; |
| 26 |
|
| 27 |
# Code to test : in this main thread |
| 28 |
|
| 29 |
create table test.t1(a int) engine=MYISAM; |
| 30 |
|
| 31 |
show global variables like "performance_schema"; |
| 32 |
show global variables like "performance_schema_max_thread%"; |
| 33 |
|
| 34 |
# Verification : in this main thread |
| 35 |
|
| 36 |
select count(*) from performance_schema.threads |
| 37 |
where name like "thread/sql/main"; |
| 38 |
|
| 39 |
select count(*) from performance_schema.threads |
| 40 |
where name like "thread/sql/OneConnection"; |
| 41 |
|
| 42 |
select event_name, operation, |
| 43 |
left(source, locate(":", source)) as short_source |
| 44 |
from performance_schema.events_waits_current; |
| 45 |
|
| 46 |
select event_name, operation, |
| 47 |
left(source, locate(":", source)) as short_source |
| 48 |
from performance_schema.events_waits_history; |
| 49 |
|
| 50 |
select event_name, operation, |
| 51 |
left(source, locate(":", source)) as short_source |
| 52 |
from performance_schema.events_waits_history_long; |
| 53 |
|
| 54 |
# Cleanup |
| 55 |
|
| 56 |
update performance_schema.setup_instruments set enabled='YES'; |
| 57 |
|
| 58 |
drop table test.t1; |
| 59 |
|