Debian Codegraph @

mysql-test/suite/perfschema/t/idx_mutex_instances.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 = count(*);
10 let $table = performance_schema.mutex_instances;
11
12 create database explain_test_db;
13 create table explain_test_db.explain_test_table (c int);
14 lock table explain_test_db.explain_test_table write;
15
16 connect(con1, 127.0.0.1, root,,);
17 --echo # Connection con1
18 --connection con1
19 # Following sql will hang
20 --send
21 insert into explain_test_db.explain_test_table values ('1');
22
23 --echo # Connection default
24 --connection default
25
26 select OBJECT_INSTANCE_BEGIN, NAME, LOCKED_BY_THREAD_ID
27 from performance_schema.mutex_instances
28 where LOCKED_BY_THREAD_ID is not NULL
29 limit 1
30 into @oib, @name, @lbtid;
31
32 ###########################################################################
33 # Test index on OBJECT_INSTANCE_BEGIN
34 ###########################################################################
35
36 let $column_count = 1;
37 let $col1 = OBJECT_INSTANCE_BEGIN;
38 let $col1_act = @oib;
39
40 --source ../include/idx_explain_test.inc
41
42 ###########################################################################
43 # Test index on NAME
44 ###########################################################################
45
46 let $column_count = 1;
47 let $col1 = NAME;
48 let $col1_act = @name;
49
50 --source ../include/idx_explain_test.inc
51
52 ###########################################################################
53 # Test index on LOCKED_BY_THREAD_ID
54 ###########################################################################
55
56 let $column_count = 1;
57 let $col1 = LOCKED_BY_THREAD_ID;
58 let $col1_act = @lbtid;
59
60 --source ../include/idx_explain_test.inc
61
62 # Cleanup
63 unlock tables;
64 --echo # connection con1
65 --connection con1
66 --reap
67
68 --echo # connection default
69 --connection default
70 --disconnect con1
71 drop table explain_test_db.explain_test_table;
72 drop database explain_test_db;