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