Debian Codegraph @

mysql-test/suite/perfschema/t/idx_events_waits_history.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_history;
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_history;
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 EVENT_ID from performance_schema.events_waits_history where THREAD_ID = $tid limit 1 into @eid;
36 --eval select $tid into @tid;
37 --enable_query_log
38
39 ###########################################################################
40 # Test index on THREAD_ID, EVENT_ID
41 ###########################################################################
42
43 let $column_count = 2;
44 let $col1 = THREAD_ID;
45 let $col2 = EVENT_ID;
46 let $col1_act = @tid;
47 let $col2_act = @eid;
48
49 --source ../include/idx_explain_test.inc
50
51 # Cleanup
52 drop table explain_test_db.t1;
53 drop database explain_test_db;