1# Tests for PERFORMANCE_SCHEMA
2
3let $MYSQLD_DATADIR= `select @@datadir`;
4let $MYSQLD_TMPDIR= `select @@tmpdir`;
5
6--disable_query_log
7update performance_schema.setup_instruments set enabled='NO';
8update performance_schema.setup_consumers set enabled='YES';
9--enable_query_log
10
11connect (con1, localhost, root, , );
12
13let $con1_THREAD_ID=`select thread_id from performance_schema.threads
14  where PROCESSLIST_ID = connection_id()`;
15
16connect (con2, localhost, root, , );
17
18let $con2_THREAD_ID=`select thread_id from performance_schema.threads
19  where PROCESSLIST_ID = connection_id()`;
20
21connect (con3, localhost, root, , );
22
23let $con3_THREAD_ID=`select thread_id from performance_schema.threads
24  where PROCESSLIST_ID = connection_id()`;
25
26connection default;
27
28--disable_query_log
29prepare stmt_dump_events from
30  "select event_name,
31     left(source, locate(\":\", source)) as short_source,
32     operation, number_of_bytes
33  from performance_schema.events_waits_history_long
34  where thread_id=? order by event_id;";
35
36prepare stmt_dump_thread from
37  "select name from performance_schema.threads where thread_id=? ;";
38--enable_query_log
39
40