Debian Codegraph @

mysql-test/suite/perfschema/t/idx_events_waits_current.test

raw
1 # Performance schema tests generally depend on specific query plans
2 # and behavior, and much of the perfschema suite is therefore disabled
3 # if the hypergraph optimizer is active.
4 --source include/not_hypergraph.inc
5
6 # Tests for PERFORMANCE_SCHEMA
7
8 #setup
9 let $select_column = END_EVENT_ID;
10 let $table = performance_schema.events_waits_current;
11
12 create database explain_test_db;
13 create table explain_test_db.t1 (c int);
14 insert into explain_test_db.t1 values ('1');
15
16 truncate table performance_schema.events_waits_current;
17
18 # Create a new Connection
19 connect(con1,127.0.0.1,root,,);
20
21 --echo # Connection 1
22 --connection con1
23
24 select connection_id() into @conid;
25
26 let $tid = `select thread_id from performance_schema.threads
27 where PROCESSLIST_ID = @conid`;
28
29 select * from explain_test_db.t1;
30
31 --echo # Default connection
32 --connection default
33
34 --disable_query_log
35 --eval select $tid into @tid;
36 --let $wait_condition = select count(*) > 0 from performance_schema.events_waits_current where THREAD_ID = @tid
37 --source include/wait_condition.inc
38 select EVENT_ID from performance_schema.events_waits_current where THREAD_ID = @tid limit 1 into @eid;
39 --enable_query_log
40
41 ###########################################################################
42 # Test index on THREAD_ID, EVENT_ID
43 ###########################################################################
44
45 let $column_count = 2;
46 let $col1 = THREAD_ID;
47 let $col2 = EVENT_ID;
48 let $col1_act = @tid;
49 let $col2_act = @eid;
50
51 --source ../include/idx_explain_test.inc
52
53 # Cleanup
54 --disconnect con1
55 drop table explain_test_db.t1;
56 drop database explain_test_db;