| 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 = LOCK_TYPE; |
| 10 |
let $table = performance_schema.metadata_locks; |
| 11 |
|
| 12 |
connect(con1, localhost, root,,); |
| 13 |
|
| 14 |
--echo # Connection con1 |
| 15 |
--connection con1 |
| 16 |
create database explain_test_db; |
| 17 |
create table explain_test_db.explain_test_table(a int); |
| 18 |
lock table explain_test_db.explain_test_table write; |
| 19 |
|
| 20 |
--echo # Connection default |
| 21 |
--connection default |
| 22 |
|
| 23 |
select OBJECT_INSTANCE_BEGIN, OWNER_THREAD_ID, OWNER_EVENT_ID |
| 24 |
from performance_schema.metadata_locks |
| 25 |
where OBJECT_TYPE = 'TABLE' |
| 26 |
and OBJECT_SCHEMA = 'explain_test_db' |
| 27 |
and OBJECT_NAME = 'explain_test_table' |
| 28 |
and LOCK_STATUS = 'GRANTED' |
| 29 |
into @oib, @o_tid, @o_eid; |
| 30 |
|
| 31 |
# Make sure we found the metadata lock to test. |
| 32 |
select @oib is not null, @o_tid is not null, @o_eid is not null; |
| 33 |
|
| 34 |
########################################################################### |
| 35 |
# Test index on OBJECT_INSTANCE_BEGIN |
| 36 |
########################################################################### |
| 37 |
|
| 38 |
let $column_count = 1; |
| 39 |
let $col1 = OBJECT_INSTANCE_BEGIN; |
| 40 |
let $col1_act = @oib; |
| 41 |
|
| 42 |
--source ../include/idx_explain_test.inc |
| 43 |
|
| 44 |
########################################################################### |
| 45 |
# Test index on OBJECT_TYPE, OBJECT_SCHEMA, OBJECT_NAME |
| 46 |
########################################################################### |
| 47 |
|
| 48 |
let $column_count = 4; |
| 49 |
let $col1 = OBJECT_TYPE; |
| 50 |
let $col2 = OBJECT_SCHEMA; |
| 51 |
let $col3 = OBJECT_NAME; |
| 52 |
let $col4 = COLUMN_NAME; |
| 53 |
let $col1_act = "TABLE"; |
| 54 |
let $col2_act = "explain_test_db"; |
| 55 |
let $col3_act = "explain_test_table"; |
| 56 |
let $col4_act = "a"; |
| 57 |
|
| 58 |
--source ../include/idx_explain_test.inc |
| 59 |
|
| 60 |
########################################################################### |
| 61 |
# Test index on OWNER_THREAD_ID, OWNER_EVENT_ID |
| 62 |
########################################################################### |
| 63 |
|
| 64 |
let $column_count = 2; |
| 65 |
let $col1 = OWNER_THREAD_ID; |
| 66 |
let $col2 = OWNER_EVENT_ID; |
| 67 |
let $col1_act = @o_tid; |
| 68 |
let $col2_act = @o_eid; |
| 69 |
|
| 70 |
--source ../include/idx_explain_test.inc |
| 71 |
|
| 72 |
--echo # Connection con1 |
| 73 |
--connection con1 |
| 74 |
unlock tables; |
| 75 |
drop table explain_test_db.explain_test_table; |
| 76 |
drop database explain_test_db; |
| 77 |
|
| 78 |
--echo # Connection default |
| 79 |
--connection default |
| 80 |
--disconnect con1 |