polardbxengine/mysql-test/suite/xengine_perfschema/t/idx_table_handles.test

75 lines
2.0 KiB
Plaintext

# 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) engine = XENGINE;
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