Debian Codegraph @

mysql-test/suite/perfschema/r/privilege.result

raw
1 show grants;
2 Grants for root@localhost
3 GRANT ALL PRIVILEGES ON *.* TO `root`@`localhost` WITH GRANT OPTION
4 GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
5 create user 'pfs_user_1'@localhost;
6 create user 'pfs_user_2'@localhost;
7 create user 'pfs_user_3'@localhost;
8 grant SELECT,INSERT,UPDATE,DELETE,DROP,CREATE on test.* to 'pfs_user_1'@localhost;
9 grant SELECT,INSERT,UPDATE,DELETE,DROP,CREATE on test.* to 'pfs_user_2'@localhost;
10 grant SELECT,INSERT,UPDATE,DELETE,DROP,CREATE on test.* to 'pfs_user_3'@localhost;
11 grant ALL on *.* to 'pfs_user_1'@localhost with GRANT OPTION;
12 grant ALL on performance_schema.* to 'pfs_user_2'@localhost
13 with GRANT OPTION;
14 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
15 grant CREATE on performance_schema.* to 'pfs_user_2'@localhost;
16 grant DROP on performance_schema.* to 'pfs_user_2'@localhost;
17 grant REFERENCES on performance_schema.* to 'pfs_user_2'@localhost;
18 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
19 grant INDEX on performance_schema.* to 'pfs_user_2'@localhost;
20 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
21 grant ALTER on performance_schema.* to 'pfs_user_2'@localhost;
22 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
23 grant CREATE TEMPORARY TABLES on performance_schema.* to 'pfs_user_2'@localhost;
24 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
25 grant EXECUTE on performance_schema.* to 'pfs_user_2'@localhost;
26 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
27 grant CREATE VIEW on performance_schema.* to 'pfs_user_2'@localhost;
28 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
29 grant SHOW VIEW on performance_schema.* to 'pfs_user_2'@localhost;
30 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
31 grant CREATE ROUTINE on performance_schema.* to 'pfs_user_2'@localhost;
32 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
33 grant ALTER ROUTINE on performance_schema.* to 'pfs_user_2'@localhost;
34 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
35 grant EVENT on performance_schema.* to 'pfs_user_2'@localhost;
36 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
37 grant TRIGGER on performance_schema.* to 'pfs_user_2'@localhost;
38 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
39 grant SELECT on performance_schema.* to 'pfs_user_2'@localhost;
40 grant INSERT on performance_schema.* to 'pfs_user_2'@localhost;
41 grant UPDATE on performance_schema.* to 'pfs_user_2'@localhost;
42 grant DELETE on performance_schema.* to 'pfs_user_2'@localhost;
43 grant LOCK TABLES on performance_schema.* to 'pfs_user_2'@localhost;
44 grant ALL on performance_schema.setup_instruments to 'pfs_user_3'@localhost
45 with GRANT OPTION;
46 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
47 grant CREATE on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
48 grant DROP on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
49 grant REFERENCES on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
50 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
51 grant INDEX on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
52 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
53 grant ALTER on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
54 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
55 grant CREATE VIEW on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
56 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
57 grant SHOW VIEW on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
58 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
59 grant TRIGGER on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
60 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
61 grant INSERT on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
62 ERROR 42000: INSERT, GRANT command denied to user 'root'@'localhost' for table `performance_schema`.`setup_instruments`
63 grant DELETE on performance_schema.setup_instruments to 'pfs_user_3'@localhost;
64 ERROR 42000: DELETE, GRANT command denied to user 'root'@'localhost' for table `performance_schema`.`setup_instruments`
65 grant SELECT on performance_schema.setup_instruments to 'pfs_user_3'@localhost
66 with GRANT OPTION;
67 grant UPDATE on performance_schema.setup_instruments to 'pfs_user_3'@localhost
68 with GRANT OPTION;
69 grant ALL on performance_schema.events_waits_current to 'pfs_user_3'@localhost
70 with GRANT OPTION;
71 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
72 grant CREATE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
73 grant DROP on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
74 grant REFERENCES on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
75 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
76 grant INDEX on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
77 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
78 grant ALTER on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
79 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
80 grant CREATE VIEW on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
81 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
82 grant SHOW VIEW on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
83 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
84 grant TRIGGER on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
85 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
86 grant INSERT on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
87 ERROR 42000: INSERT, GRANT command denied to user 'root'@'localhost' for table `performance_schema`.`events_waits_current`
88 grant UPDATE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
89 ERROR 42000: UPDATE, GRANT command denied to user 'root'@'localhost' for table `performance_schema`.`events_waits_current`
90 grant DELETE on performance_schema.events_waits_current to 'pfs_user_3'@localhost;
91 ERROR 42000: DELETE, GRANT command denied to user 'root'@'localhost' for table `performance_schema`.`events_waits_current`
92 grant SELECT on performance_schema.events_waits_current to 'pfs_user_3'@localhost
93 with GRANT OPTION;
94 grant ALL on performance_schema.file_instances to 'pfs_user_3'@localhost
95 with GRANT OPTION;
96 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
97 grant CREATE on performance_schema.file_instances to 'pfs_user_3'@localhost;
98 grant DROP on performance_schema.file_instances to 'pfs_user_3'@localhost;
99 grant REFERENCES on performance_schema.file_instances to 'pfs_user_3'@localhost;
100 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
101 grant INDEX on performance_schema.file_instances to 'pfs_user_3'@localhost;
102 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
103 grant ALTER on performance_schema.file_instances to 'pfs_user_3'@localhost;
104 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
105 grant CREATE VIEW on performance_schema.file_instances to 'pfs_user_3'@localhost;
106 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
107 grant SHOW VIEW on performance_schema.file_instances to 'pfs_user_3'@localhost;
108 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
109 grant TRIGGER on performance_schema.file_instances to 'pfs_user_3'@localhost;
110 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
111 grant INSERT on performance_schema.file_instances to 'pfs_user_3'@localhost;
112 ERROR 42000: INSERT, GRANT command denied to user 'root'@'localhost' for table `performance_schema`.`file_instances`
113 grant UPDATE on performance_schema.file_instances to 'pfs_user_3'@localhost;
114 ERROR 42000: UPDATE, GRANT command denied to user 'root'@'localhost' for table `performance_schema`.`file_instances`
115 grant DELETE on performance_schema.file_instances to 'pfs_user_3'@localhost;
116 ERROR 42000: DELETE, GRANT command denied to user 'root'@'localhost' for table `performance_schema`.`file_instances`
117 grant SELECT on performance_schema.file_instances to 'pfs_user_3'@localhost
118 with GRANT OPTION;
119 grant LOCK TABLES on performance_schema.* to 'pfs_user_3'@localhost
120 with GRANT OPTION;
121 flush privileges;
122 drop table if exists test.t1;
123 rename table performance_schema.setup_instruments to test.t1;
124 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
125 rename table performance_schema.events_waits_current to test.t1;
126 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
127 rename table performance_schema.file_instances to test.t1;
128 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
129 rename table performance_schema.setup_instruments to performance_schema.t1;
130 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
131 rename table performance_schema.events_waits_current to performance_schema.t1;
132 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
133 rename table performance_schema.file_instances to performance_schema.t1;
134 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
135 rename table performance_schema.setup_instruments
136 to performance_schema.events_waits_current;
137 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
138 rename table performance_schema.events_waits_current
139 to performance_schema.setup_instruments;
140 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
141 create procedure performance_schema.my_proc() begin end;
142 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
143 create function performance_schema.my_func() returns int return 0;
144 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
145 create event performance_schema.my_event on schedule every 15 minute
146 do begin end;
147 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
148 create trigger performance_schema.bi_setup_instruments
149 before insert on performance_schema.setup_instruments
150 for each row begin end;
151 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
152 create trigger performance_schema.bi_events_waits_current
153 before insert on performance_schema.events_waits_current
154 for each row begin end;
155 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
156 create trigger performance_schema.bi_file_instances
157 before insert on performance_schema.file_instances
158 for each row begin end;
159 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
160 create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
161 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
162 create table test.t1 like performance_schema.setup_instruments;
163 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
164 create table test.t1 like performance_schema.events_waits_current;
165 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
166 create table test.t1 like performance_schema.file_instances;
167 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
168 insert into performance_schema.setup_instruments
169 set name="foo";
170 ERROR 42000: INSERT command denied to user 'root'@'localhost' for table `performance_schema`.`setup_instruments`
171 insert into performance_schema.events_waits_current
172 set name="foo";
173 ERROR 42000: INSERT command denied to user 'root'@'localhost' for table `performance_schema`.`events_waits_current`
174 insert into performance_schema.file_instances
175 set name="foo";
176 ERROR 42000: INSERT command denied to user 'root'@'localhost' for table `performance_schema`.`file_instances`
177 delete from performance_schema.setup_instruments;
178 ERROR 42000: DELETE command denied to user 'root'@'localhost' for table `performance_schema`.`setup_instruments`
179 delete from performance_schema.events_waits_current;
180 ERROR 42000: DELETE command denied to user 'root'@'localhost' for table `performance_schema`.`events_waits_current`
181 delete from performance_schema.file_instances;
182 ERROR 42000: DELETE command denied to user 'root'@'localhost' for table `performance_schema`.`file_instances`
183 lock table performance_schema.setup_instruments read;
184 unlock tables;
185 lock table performance_schema.setup_instruments write;
186 unlock tables;
187 lock table performance_schema.events_waits_current read;
188 ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table `performance_schema`.`events_waits_current`
189 unlock tables;
190 lock table performance_schema.events_waits_current write;
191 ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table `performance_schema`.`events_waits_current`
192 unlock tables;
193 lock table performance_schema.file_instances read;
194 ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table `performance_schema`.`file_instances`
195 unlock tables;
196 lock table performance_schema.file_instances write;
197 ERROR 42000: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table `performance_schema`.`file_instances`
198 unlock tables;
199 #
200 # WL#4818, NFS2: Can use grants to give normal user access
201 # to view data from _current and _history tables
202 #
203 # Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
204 # (Except for events_waits_current, which is granted.)
205 SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1;
206 can select
207 can select
208 SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1;
209 can select
210 can select
211 SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1;
212 can select
213 can select
214 SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
215 can select
216 can select
217 SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
218 can select
219 can select
220 connect con1, localhost, pfs_user_1, , ;
221 drop table if exists test.t1;
222 rename table performance_schema.setup_instruments to test.t1;
223 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
224 rename table performance_schema.events_waits_current to test.t1;
225 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
226 rename table performance_schema.file_instances to test.t1;
227 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
228 rename table performance_schema.setup_instruments to performance_schema.t1;
229 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
230 rename table performance_schema.events_waits_current to performance_schema.t1;
231 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
232 rename table performance_schema.file_instances to performance_schema.t1;
233 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
234 rename table performance_schema.setup_instruments
235 to performance_schema.events_waits_current;
236 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
237 rename table performance_schema.events_waits_current
238 to performance_schema.setup_instruments;
239 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
240 create procedure performance_schema.my_proc() begin end;
241 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
242 create function performance_schema.my_func() returns int return 0;
243 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
244 create event performance_schema.my_event on schedule every 15 minute
245 do begin end;
246 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
247 create trigger performance_schema.bi_setup_instruments
248 before insert on performance_schema.setup_instruments
249 for each row begin end;
250 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
251 create trigger performance_schema.bi_events_waits_current
252 before insert on performance_schema.events_waits_current
253 for each row begin end;
254 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
255 create trigger performance_schema.bi_file_instances
256 before insert on performance_schema.file_instances
257 for each row begin end;
258 ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
259 create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
260 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
261 create table test.t1 like performance_schema.setup_instruments;
262 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
263 create table test.t1 like performance_schema.events_waits_current;
264 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
265 create table test.t1 like performance_schema.file_instances;
266 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
267 insert into performance_schema.setup_instruments
268 set name="foo";
269 ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`setup_instruments`
270 insert into performance_schema.events_waits_current
271 set name="foo";
272 ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`events_waits_current`
273 insert into performance_schema.file_instances
274 set name="foo";
275 ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`file_instances`
276 delete from performance_schema.setup_instruments;
277 ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`setup_instruments`
278 delete from performance_schema.events_waits_current;
279 ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`events_waits_current`
280 delete from performance_schema.file_instances;
281 ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`file_instances`
282 lock table performance_schema.setup_instruments read;
283 unlock tables;
284 lock table performance_schema.setup_instruments write;
285 unlock tables;
286 lock table performance_schema.events_waits_current read;
287 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`events_waits_current`
288 unlock tables;
289 lock table performance_schema.events_waits_current write;
290 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`events_waits_current`
291 unlock tables;
292 lock table performance_schema.file_instances read;
293 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`file_instances`
294 unlock tables;
295 lock table performance_schema.file_instances write;
296 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_1'@'localhost' for table `performance_schema`.`file_instances`
297 unlock tables;
298 #
299 # WL#4818, NFS2: Can use grants to give normal user access
300 # to view data from _current and _history tables
301 #
302 # Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
303 # (Except for events_waits_current, which is granted.)
304 SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1;
305 can select
306 can select
307 SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1;
308 can select
309 can select
310 SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1;
311 can select
312 can select
313 SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
314 can select
315 can select
316 SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
317 can select
318 can select
319 disconnect con1;
320 connect con2, localhost, pfs_user_2, , ;
321 drop table if exists test.t1;
322 rename table performance_schema.setup_instruments to test.t1;
323 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
324 rename table performance_schema.events_waits_current to test.t1;
325 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
326 rename table performance_schema.file_instances to test.t1;
327 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
328 rename table performance_schema.setup_instruments to performance_schema.t1;
329 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
330 rename table performance_schema.events_waits_current to performance_schema.t1;
331 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
332 rename table performance_schema.file_instances to performance_schema.t1;
333 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
334 rename table performance_schema.setup_instruments
335 to performance_schema.events_waits_current;
336 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
337 rename table performance_schema.events_waits_current
338 to performance_schema.setup_instruments;
339 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
340 create procedure performance_schema.my_proc() begin end;
341 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
342 create function performance_schema.my_func() returns int return 0;
343 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
344 create event performance_schema.my_event on schedule every 15 minute
345 do begin end;
346 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
347 create trigger performance_schema.bi_setup_instruments
348 before insert on performance_schema.setup_instruments
349 for each row begin end;
350 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
351 create trigger performance_schema.bi_events_waits_current
352 before insert on performance_schema.events_waits_current
353 for each row begin end;
354 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
355 create trigger performance_schema.bi_file_instances
356 before insert on performance_schema.file_instances
357 for each row begin end;
358 ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
359 create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
360 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
361 create table test.t1 like performance_schema.setup_instruments;
362 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
363 create table test.t1 like performance_schema.events_waits_current;
364 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
365 create table test.t1 like performance_schema.file_instances;
366 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
367 insert into performance_schema.setup_instruments
368 set name="foo";
369 ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`setup_instruments`
370 insert into performance_schema.events_waits_current
371 set name="foo";
372 ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`events_waits_current`
373 insert into performance_schema.file_instances
374 set name="foo";
375 ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`file_instances`
376 delete from performance_schema.setup_instruments;
377 ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`setup_instruments`
378 delete from performance_schema.events_waits_current;
379 ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`events_waits_current`
380 delete from performance_schema.file_instances;
381 ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`file_instances`
382 lock table performance_schema.setup_instruments read;
383 unlock tables;
384 lock table performance_schema.setup_instruments write;
385 unlock tables;
386 lock table performance_schema.events_waits_current read;
387 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`events_waits_current`
388 unlock tables;
389 lock table performance_schema.events_waits_current write;
390 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`events_waits_current`
391 unlock tables;
392 lock table performance_schema.file_instances read;
393 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`file_instances`
394 unlock tables;
395 lock table performance_schema.file_instances write;
396 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_2'@'localhost' for table `performance_schema`.`file_instances`
397 unlock tables;
398 #
399 # WL#4818, NFS2: Can use grants to give normal user access
400 # to view data from _current and _history tables
401 #
402 # Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
403 # (Except for events_waits_current, which is granted.)
404 SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1;
405 can select
406 can select
407 SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1;
408 can select
409 can select
410 SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1;
411 can select
412 can select
413 SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
414 can select
415 can select
416 SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
417 can select
418 can select
419 disconnect con2;
420 connect con3, localhost, pfs_user_3, , ;
421 drop table if exists test.t1;
422 rename table performance_schema.setup_instruments to test.t1;
423 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
424 rename table performance_schema.events_waits_current to test.t1;
425 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
426 rename table performance_schema.file_instances to test.t1;
427 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
428 rename table performance_schema.setup_instruments to performance_schema.t1;
429 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
430 rename table performance_schema.events_waits_current to performance_schema.t1;
431 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
432 rename table performance_schema.file_instances to performance_schema.t1;
433 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
434 rename table performance_schema.setup_instruments
435 to performance_schema.events_waits_current;
436 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
437 rename table performance_schema.events_waits_current
438 to performance_schema.setup_instruments;
439 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
440 create procedure performance_schema.my_proc() begin end;
441 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
442 create function performance_schema.my_func() returns int return 0;
443 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
444 create event performance_schema.my_event on schedule every 15 minute
445 do begin end;
446 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
447 create trigger performance_schema.bi_setup_instruments
448 before insert on performance_schema.setup_instruments
449 for each row begin end;
450 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
451 create trigger performance_schema.bi_events_waits_current
452 before insert on performance_schema.events_waits_current
453 for each row begin end;
454 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
455 create trigger performance_schema.bi_file_instances
456 before insert on performance_schema.file_instances
457 for each row begin end;
458 ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
459 create table test.t1(a int) engine=PERFORMANCE_SCHEMA;
460 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
461 create table test.t1 like performance_schema.setup_instruments;
462 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
463 create table test.t1 like performance_schema.events_waits_current;
464 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
465 create table test.t1 like performance_schema.file_instances;
466 ERROR HY000: Can't create table `test`.`t1` (errno: 131 "Command not supported by the engine")
467 insert into performance_schema.setup_instruments
468 set name="foo";
469 ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`setup_instruments`
470 insert into performance_schema.events_waits_current
471 set name="foo";
472 ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`events_waits_current`
473 insert into performance_schema.file_instances
474 set name="foo";
475 ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`file_instances`
476 delete from performance_schema.setup_instruments;
477 ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`setup_instruments`
478 delete from performance_schema.events_waits_current;
479 ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`events_waits_current`
480 delete from performance_schema.file_instances;
481 ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`file_instances`
482 lock table performance_schema.setup_instruments read;
483 unlock tables;
484 lock table performance_schema.setup_instruments write;
485 unlock tables;
486 lock table performance_schema.events_waits_current read;
487 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`events_waits_current`
488 unlock tables;
489 lock table performance_schema.events_waits_current write;
490 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`events_waits_current`
491 unlock tables;
492 lock table performance_schema.file_instances read;
493 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`file_instances`
494 unlock tables;
495 lock table performance_schema.file_instances write;
496 ERROR 42000: SELECT, LOCK TABLES command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`file_instances`
497 unlock tables;
498 #
499 # WL#4818, NFS2: Can use grants to give normal user access
500 # to view data from _current and _history tables
501 #
502 # Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3.
503 # (Except for events_waits_current, which is granted.)
504 SELECT "can select" FROM performance_schema.events_waits_history LIMIT 1;
505 ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`events_waits_history`
506 SELECT "can select" FROM performance_schema.events_waits_history_long LIMIT 1;
507 ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`events_waits_history_long`
508 SELECT "can select" FROM performance_schema.events_waits_current LIMIT 1;
509 can select
510 can select
511 SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIMIT 1;
512 ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`events_waits_summary_by_instance`
513 SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
514 ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table `performance_schema`.`file_summary_by_instance`
515 disconnect con3;
516 connection default;
517 revoke all privileges, grant option from 'pfs_user_1'@localhost;
518 revoke all privileges, grant option from 'pfs_user_2'@localhost;
519 revoke all privileges, grant option from 'pfs_user_3'@localhost;
520 drop user 'pfs_user_1'@localhost;
521 drop user 'pfs_user_2'@localhost;
522 drop user 'pfs_user_3'@localhost;
523 flush privileges;
524 # Test cases from WL#4818
525 # Setup user
526 CREATE user pfs_user_4;
527 connect pfs_user_4, localhost, pfs_user_4, ,"*NO-ONE*";
528 #
529 # WL#4818, NFS4: Normal user does not have access to view data
530 # without grants
531 #
532 connection pfs_user_4;
533 # Select as pfs_user_4 should fail without grant
534 SELECT event_id FROM performance_schema.events_waits_history;
535 ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`events_waits_history`
536 SELECT event_id FROM performance_schema.events_waits_history_long;
537 ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`events_waits_history_long`
538 SELECT event_id FROM performance_schema.events_waits_current;
539 ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`events_waits_current`
540 SELECT event_name FROM performance_schema.events_waits_summary_by_instance;
541 ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`events_waits_summary_by_instance`
542 SELECT event_name FROM performance_schema.file_summary_by_instance;
543 ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`file_summary_by_instance`
544 #
545 # WL#4818, NFS3: Normal user does not have access to change what is
546 # instrumented without grants
547 #
548 connection pfs_user_4;
549 # User pfs_user_4 should not be allowed to tweak instrumentation without
550 # explicit grant
551 UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
552 ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`setup_instruments`
553 UPDATE performance_schema.setup_instruments SET enabled = 'YES'
554 WHERE name LIKE 'wait/synch/mutex/%'
555 OR name LIKE 'wait/synch/rwlock/%';
556 ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`setup_instruments`
557 UPDATE performance_schema.setup_consumers SET enabled = 'YES';
558 ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`setup_consumers`
559 UPDATE performance_schema.setup_timers SET timer_name = 'TICK';
560 ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`setup_timers`
561 TRUNCATE TABLE performance_schema.events_waits_history_long;
562 ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`events_waits_history_long`
563 TRUNCATE TABLE performance_schema.events_waits_history;
564 ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`events_waits_history`
565 TRUNCATE TABLE performance_schema.events_waits_current;
566 ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table `performance_schema`.`events_waits_current`
567 #
568 # WL#4814, NFS1: Can use grants to give normal user access
569 # to turn on and off instrumentation
570 #
571 connection default;
572 # Grant access to change tables with the root account
573 GRANT UPDATE ON performance_schema.setup_consumers TO pfs_user_4;
574 GRANT UPDATE, SELECT ON performance_schema.setup_timers TO pfs_user_4;
575 GRANT UPDATE, SELECT ON performance_schema.setup_instruments TO pfs_user_4;
576 GRANT DROP ON performance_schema.events_waits_current TO pfs_user_4;
577 GRANT DROP ON performance_schema.events_waits_history TO pfs_user_4;
578 GRANT DROP ON performance_schema.events_waits_history_long TO pfs_user_4;
579 connection pfs_user_4;
580 # User pfs_user_4 should now be allowed to tweak instrumentation
581 UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
582 UPDATE performance_schema.setup_instruments SET enabled = 'YES'
583 WHERE name LIKE 'wait/synch/mutex/%'
584 OR name LIKE 'wait/synch/rwlock/%';
585 UPDATE performance_schema.setup_consumers SET enabled = 'YES';
586 UPDATE performance_schema.setup_timers SET timer_name = 'TICK' WHERE name <> "wait";
587 Warnings:
588 Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
589 TRUNCATE TABLE performance_schema.events_waits_history_long;
590 TRUNCATE TABLE performance_schema.events_waits_history;
591 TRUNCATE TABLE performance_schema.events_waits_current;
592 # Clean up
593 disconnect pfs_user_4;
594 connection default;
595 REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4;
596 DROP USER pfs_user_4;
597 flush privileges;
598 UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES';
599 UPDATE performance_schema.setup_consumers SET enabled = 'YES';
600 UPDATE performance_schema.setup_timers SET timer_name = 'MICROSECOND' where name="idle";
601 Warnings:
602 Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
603 UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="stage";
604 Warnings:
605 Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
606 UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="statement";
607 Warnings:
608 Warning 1287 'performance_schema.setup_timers' is deprecated and will be removed in a future release
609 #
610 # WL#2284: Increase the length of a user name
611 #
612 CREATE USER 'user_name_len_22_01234'@localhost;
613 GRANT ALL ON performance_schema.* TO 'user_name_len_22_01234'@localhost with GRANT OPTION;
614 ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema'
615 REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user_name_len_22_01234'@localhost;
616 DROP USER 'user_name_len_22_01234'@localhost;