summaryrefslogtreecommitdiff
path: root/mysql-test/suite/perfschema/t/start_server_off.test
blob: 6fdc02acf9b68e249302bcb9f764c4bd5a222417 (plain)
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
# Tests for PERFORMANCE_SCHEMA

--source include/not_embedded.inc
--source include/have_perfschema.inc

--source ../include/start_server_common.inc

select * from information_schema.engines
  where engine = "PERFORMANCE_SCHEMA";

# Expecting all off / zero
show status like "performance_schema%";
show variables like "performance_schema";

# Expect all consumers disabled

select * from performance_schema.setup_consumers;

# Expect no instruments

select * from performance_schema.setup_instruments;

select * from performance_schema.setup_actors;
select * from performance_schema.setup_objects;
select * from performance_schema.setup_timers;

# Expect INSERT to fail with an error

--error ER_WRONG_PERFSCHEMA_USAGE
insert into performance_schema.setup_objects values ('TABLE', 'myschema', 'myobject', 'YES', 'YES');

--error ER_WRONG_PERFSCHEMA_USAGE
insert into performance_schema.setup_actors values ('myhost', 'mysuser', 'myrole', 'YES', 'YES');

# Expect SELECT, UPDATE, DELETE and TRUNCATE to affect 0 rows, but with
# no error because the target row(s) will not be found

select * from performance_schema.setup_objects;
update performance_schema.setup_objects set OBJECT_NAME = 'myobject';
delete from performance_schema.setup_objects;

select * from performance_schema.setup_actors;
update performance_schema.setup_actors set HOST = 'myhost';
delete from performance_schema.setup_actors;

truncate performance_schema.events_stages_history_long;
truncate performance_schema.events_statements_history_long;
truncate performance_schema.events_waits_history_long;
truncate performance_schema.setup_objects;
truncate performance_schema.setup_actors;

--disable_warnings
# Expect that status variables are still accessible
show global status like "performance_schema%";
show session status like "performance_schema%";
--enable_warnings