mariadb/mysql-test/suite/perfschema/t/dml_setup_timers.test
Alexander Barkov 59dd58b17e MDEV-8692 prefschema test failures on ARM (on Debian build system)
A few tests assumes that the CYCLE timer is always available,
which is not true on some platforms (e.g. ARM).
Fixing the tests not to reply on the CYCLE availability.
2015-10-30 10:10:43 +04:00

66 lines
1.8 KiB
Text

# Tests for PERFORMANCE_SCHEMA
--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/have_timer_cycle.inc
# Set to a known state
update performance_schema.setup_timers
set timer_name='CYCLE' where name="wait";
update performance_schema.setup_timers
set timer_name='NANOSECOND' where name="stage";
update performance_schema.setup_timers
set timer_name='NANOSECOND' where name="statement";
update performance_schema.setup_timers
set timer_name='MICROSECOND' where name="idle";
select * from performance_schema.setup_timers;
select * from performance_schema.setup_timers
where name='Wait';
select * from performance_schema.setup_timers
where timer_name='CYCLE';
--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.setup_timers
set name='FOO', timer_name='CYCLE';
--error ER_WRONG_PERFSCHEMA_USAGE
update performance_schema.setup_timers
set name='FOO';
update performance_schema.setup_timers
set timer_name='MILLISECOND';
select * from performance_schema.setup_timers;
update performance_schema.setup_timers
set timer_name='CYCLE';
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.setup_timers;
--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.setup_timers
where name='Wait';
LOCK TABLES performance_schema.setup_timers READ;
UNLOCK TABLES;
LOCK TABLES performance_schema.setup_timers WRITE;
UNLOCK TABLES;
# Cleanup, restore the default values
update performance_schema.setup_timers
set timer_name='CYCLE' where name="wait";
update performance_schema.setup_timers
set timer_name='NANOSECOND' where name="stage";
update performance_schema.setup_timers
set timer_name='NANOSECOND' where name="statement";
update performance_schema.setup_timers
set timer_name='MICROSECOND' where name="idle";
select * from performance_schema.setup_timers;