Debian Codegraph @

mysql-test/suite/perfschema/t/idx_events_transactions_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_transactions_current;
11
12 create user foo@localhost;
13 grant ALL on *.* to foo@localhost;
14
15 truncate table performance_schema.events_transactions_current;
16
17 # Create a new Connection
18 connect(con1,localhost,foo,,);
19
20 --echo # Connection 1
21 --connection con1
22
23 select connection_id() into @conid;
24
25 let $tid = `select thread_id from performance_schema.threads
26 where PROCESSLIST_ID = @conid`;
27
28 start transaction;
29
30 --echo # Default connection
31 --connection default
32
33 --disable_query_log
34 --eval select $tid into @tid;
35 --let $wait_condition = select count(*) > 0 from performance_schema.events_transactions_current where THREAD_ID = @tid
36 --source include/wait_condition.inc
37 select EVENT_ID from performance_schema.events_transactions_current where THREAD_ID = @tid and EVENT_NAME= 'transaction' into @eid;
38 --enable_query_log
39
40 ###########################################################################
41 # Test index on THREAD_ID, EVENT_ID
42 ###########################################################################
43
44 let $column_count = 2;
45 let $col1 = THREAD_ID;
46 let $col2 = EVENT_ID;
47 let $col1_act = @tid;
48 let $col2_act = @eid;
49
50 --source ../include/idx_explain_test.inc
51
52 commit;
53
54 # Cleanup
55 --disconnect con1
56 drop user foo@localhost;