1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
# Performance schema tests generally depend on specific query plans
# and behavior, and much of the perfschema suite is therefore disabled
# if the hypergraph optimizer is active.
--source include/not_hypergraph.inc
# Tests for PERFORMANCE_SCHEMA
#setup
let $select_column = COUNT(*);
let $table = performance_schema.table_handles;
connect(con1, localhost, root,,);
--echo # Connection con1
--connection con1
create database explain_test_db;
create table explain_test_db.explain_test_table(a int);
lock table explain_test_db.explain_test_table write;
insert into explain_test_db.explain_test_table values (1);
--echo # Connection default
--connection default
#select * from performance_schema.table_handles;
select OBJECT_INSTANCE_BEGIN, OWNER_THREAD_ID, OWNER_EVENT_ID
from performance_schema.table_handles
where OBJECT_NAME = 'explain_test_table'
into @oib, @o_tid, @o_eid;
###########################################################################
# Test index on OBJECT_INSTANCE_BEGIN
###########################################################################
let $column_count = 1;
let $col1 = OBJECT_INSTANCE_BEGIN;
let $col1_act = @oib;
--source ../include/idx_explain_test.inc
###########################################################################
# Test index on OBJECT_TYPE, OBJET_SCHEMA, OBJECT_NAME
###########################################################################
let $column_count = 3;
let $col1 = OBJECT_TYPE;
let $col2 = OBJECT_SCHEMA;
let $col3 = OBJECT_NAME;
let $col1_act = "TABLE";
let $col2_act = "explain_test_db";
let $col3_act = "explain_test_table";
--source ../include/idx_explain_test.inc
###########################################################################
# Test index on OWNER_THREAD_ID, OWNER_EVENT_ID
###########################################################################
let $column_count = 2;
let $col1 = OWNER_THREAD_ID;
let $col2 = OWNER_EVENT_ID;
let $col1_act = @o_tid;
let $col2_act = @o_eid;
--source ../include/idx_explain_test.inc
# Cleanup
--echo # Connection con1
--connection con1
unlock tables;
drop table explain_test_db.explain_test_table;
drop database explain_test_db;
--echo # Connection default
--connection default
--disconnect con1
|