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
80
81
82
83
84
|
drop table if exists test.setup_objects;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
create table test.setup_objects as
select * from performance_schema.setup_objects;
truncate table performance_schema.setup_objects;
select * from performance_schema.setup_objects;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
select * from performance_schema.setup_objects
where object_type = 'TABLE'
order by object_type, object_schema, object_name;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
set sql_mode= '';
insert into performance_schema.setup_objects
set object_type='ILLEGAL', object_schema='FOO', object_name='BAR',
enabled='YES', timed='YES';
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails
set sql_mode= DEFAULT;
insert into performance_schema.setup_objects
set object_type='TABLE', 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='NO';
ERROR 23000: Can't write; duplicate key in table 'setup_objects'
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;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
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;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
TABLE FOO BAR NO YES
set statement sql_mode = '' for
update performance_schema.setup_objects
set object_type='ILLEGAL';
ERROR HY000: Invalid performance_schema usage
update performance_schema.setup_objects
set object_schema='ILLEGAL';
ERROR HY000: Invalid performance_schema usage
update performance_schema.setup_objects
set object_name='ILLEGAL';
ERROR HY000: Invalid performance_schema usage
update performance_schema.setup_objects
set enabled='NO', timed='NO';
select * from performance_schema.setup_objects
order by object_type, object_schema, object_name;
OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED
TABLE FOO BAR NO NO
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;
truncate table performance_schema.setup_objects;
insert into performance_schema.setup_objects
select * from test.setup_objects;
drop table test.setup_objects;
SET sql_mode = default;
#
# MDEV-25325 column_comment for performance_schema tables
#
select column_name, column_comment
from information_schema.columns
where table_schema='performance_schema' and table_name='setup_objects';
column_name column_comment
OBJECT_TYPE Type of object to instrument.
OBJECT_SCHEMA Schema containing the object, either the literal or % for any schema.
OBJECT_NAME Name of the instrumented object, either the literal or % for any object.
ENABLED Whether the object's events are instrumented or not. Can be disabled, in which case monitoring is not enabled for those objects.
TIMED Whether the object's events are timed or not. Can be modified.
|