mariadb/mysql-test/suite/perfschema/t/dml_setup_objects.test
Sergei Golubchik d74414399d perfschema 5.6.10 initial commit.
10.0 files
2014-05-06 23:20:50 +02:00

93 lines
2.6 KiB
Text

# Tests for PERFORMANCE_SCHEMA
--source include/not_embedded.inc
--source include/have_perfschema.inc
--disable_warnings
drop table if exists test.setup_objects;
--enable_warnings
# Save the setup
create table test.setup_objects as
select * from performance_schema.setup_objects;
truncate table performance_schema.setup_objects;
# Test
select * from performance_schema.setup_objects;
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
select * from performance_schema.setup_objects
where object_type = 'TABLE'
order by object_type, object_schema, object_name;
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
--error ER_NO_REFERENCED_ROW_2
insert into performance_schema.setup_objects
set object_type='ILLEGAL', object_schema='FOO', object_name='BAR',
enabled='YES', timed='YES';
insert into performance_schema.setup_objects
set object_type='TABLE', object_schema='FOO', object_name='BAR',
enabled='YES', timed='YES';
--error ER_DUP_KEY
insert into performance_schema.setup_objects
set object_type='TABLE', object_schema='FOO', object_name='BAR',
enabled='YES', timed='NO';
delete from performance_schema.setup_objects
where object_type='TABLE' and object_schema='FOO';
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
insert into performance_schema.setup_objects
set object_type='TABLE', object_schema='FOO', object_name='BAR',
enabled='NO', timed='YES';
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.setup_objects
set object_type='ILLEGAL';
--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.setup_objects
set object_schema='ILLEGAL';
--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.setup_objects
set object_name='ILLEGAL';
update performance_schema.setup_objects
set enabled='NO', timed='NO';
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
update performance_schema.setup_objects
set enabled='YES', timed='YES';
delete from performance_schema.setup_objects
where object_type = 'TABLE';
delete from performance_schema.setup_objects;
LOCK TABLES performance_schema.setup_objects READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.setup_objects WRITE;
UNLOCK TABLES;
# Restore the setup
truncate table performance_schema.setup_objects;
insert into performance_schema.setup_objects
select * from test.setup_objects;
drop table test.setup_objects;