1 # Tests for PERFORMANCE_SCHEMA
7 ## The result of show grants is not consistent across platforms ...
10 ## Not enforced yet: deny CREATE_ACL and DROP_ACL
11 ## Waiting to remove .FRM files first
13 ## --error ER_DBACCESS_DENIED_ERROR
14 ## create table performance_schema.t1(a int);
16 ## --error ER_DBACCESS_DENIED_ERROR
17 ## drop table performance_schema.t1;
19 ## --error ER_DBACCESS_DENIED_ERROR
20 ## create table performance_schema.setup_instruments(a int);
22 ## --error ER_DBACCESS_DENIED_ERROR
23 ## create table performance_schema.events_waits_current(a int);
25 ## --error ER_DBACCESS_DENIED_ERROR
26 ## create table performance_schema.file_instances(a int);
28 ## --error ER_DBACCESS_DENIED_ERROR
29 ## drop table performance_schema.setup_instruments;
31 ## --error ER_DBACCESS_DENIED_ERROR
32 ## drop table performance_schema.events_waits_current;
34 ## --error ER_DBACCESS_DENIED_ERROR
35 ## drop table performance_schema.file_instances;
37 --error ER_DBACCESS_DENIED_ERROR
38 rename
table performance_schema.setup_instruments
to test.t1;
40 --error ER_DBACCESS_DENIED_ERROR
41 rename
table performance_schema.events_waits_current
to test.t1;
43 --error ER_DBACCESS_DENIED_ERROR
44 rename
table performance_schema.file_instances
to test.t1;
46 --error ER_DBACCESS_DENIED_ERROR
47 rename
table performance_schema.setup_instruments
to performance_schema.t1;
49 --error ER_DBACCESS_DENIED_ERROR
50 rename
table performance_schema.events_waits_current
to performance_schema.t1;
52 --error ER_DBACCESS_DENIED_ERROR
53 rename
table performance_schema.file_instances
to performance_schema.t1;
55 --error ER_DBACCESS_DENIED_ERROR
56 rename
table performance_schema.setup_instruments
57 to performance_schema.events_waits_current;
59 --error ER_DBACCESS_DENIED_ERROR
60 rename
table performance_schema.events_waits_current
61 to performance_schema.setup_instruments;
63 --error ER_DBACCESS_DENIED_ERROR
64 create procedure performance_schema.my_proc() begin end;
66 --error ER_DBACCESS_DENIED_ERROR
67 create
function performance_schema.my_func() returns
int return 0;
69 --error ER_DBACCESS_DENIED_ERROR
70 create
event performance_schema.my_event on schedule every 15 minute
73 --error ER_DBACCESS_DENIED_ERROR
74 create trigger performance_schema.bi_setup_instruments
75 before insert on performance_schema.setup_instruments
76 for each row begin end;
78 --error ER_DBACCESS_DENIED_ERROR
79 create trigger performance_schema.bi_events_waits_current
80 before insert on performance_schema.events_waits_current
81 for each row begin end;
83 --error ER_DBACCESS_DENIED_ERROR
84 create trigger performance_schema.bi_file_instances
85 before insert on performance_schema.file_instances
86 for each row begin end;
88 --error ER_WRONG_PERFSCHEMA_USAGE
89 create
table test.t1(a
int) engine=PERFORMANCE_SCHEMA;
91 --error ER_WRONG_PERFSCHEMA_USAGE
92 create
table test.t1 like performance_schema.setup_instruments;
94 --error ER_WRONG_PERFSCHEMA_USAGE
95 create
table test.t1 like performance_schema.events_waits_current;
97 --error ER_WRONG_PERFSCHEMA_USAGE
98 create
table test.t1 like performance_schema.file_instances;
100 --error ER_TABLEACCESS_DENIED_ERROR
101 insert into performance_schema.setup_instruments
104 --error ER_TABLEACCESS_DENIED_ERROR
105 insert into performance_schema.events_waits_current
108 --error ER_TABLEACCESS_DENIED_ERROR
109 insert into performance_schema.file_instances
112 --error ER_TABLEACCESS_DENIED_ERROR
113 delete from performance_schema.setup_instruments;
115 --error ER_TABLEACCESS_DENIED_ERROR
116 delete from performance_schema.events_waits_current;
118 --error ER_TABLEACCESS_DENIED_ERROR
119 delete from performance_schema.file_instances;
121 lock
table performance_schema.setup_instruments read;
124 lock
table performance_schema.setup_instruments write;
127 --error ER_TABLEACCESS_DENIED_ERROR
128 lock
table performance_schema.events_waits_current read;
131 --error ER_TABLEACCESS_DENIED_ERROR
132 lock
table performance_schema.events_waits_current write;
135 --error ER_TABLEACCESS_DENIED_ERROR
136 lock
table performance_schema.file_instances read;
139 --error ER_TABLEACCESS_DENIED_ERROR
140 lock
table performance_schema.file_instances write;
144 --echo # WL#4818, NFS2: Can use grants
to give normal user access
145 --echo #
to view data from _current and _history tables
147 --echo # Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
148 --echo # (Except
for events_waits_current, which is granted.)
150 # Errors here will be caught by the diff afterwards
151 --disable_abort_on_error
153 SELECT
"can select" FROM performance_schema.events_waits_history LIMIT 1;
155 SELECT
"can select" FROM performance_schema.events_waits_history_long LIMIT 1;
157 SELECT
"can select" FROM performance_schema.events_waits_current LIMIT 1;
159 SELECT
"can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
161 SELECT
"can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
163 --enable_abort_on_error