Debian Codegraph @

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

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