diff options
Diffstat (limited to 'mysql-test/suite/perfschema/t/privilege.test')
-rw-r--r-- | mysql-test/suite/perfschema/t/privilege.test | 160 |
1 files changed, 70 insertions, 90 deletions
diff --git a/mysql-test/suite/perfschema/t/privilege.test b/mysql-test/suite/perfschema/t/privilege.test index 2d682de2870..277ba9bf3b8 100644 --- a/mysql-test/suite/perfschema/t/privilege.test +++ b/mysql-test/suite/perfschema/t/privilege.test @@ -76,136 +76,128 @@ grant DELETE on performance_schema.* to 'pfs_user_2'@localhost; grant LOCK TABLES on performance_schema.* to 'pfs_user_2'@localhost; # Test denied privileges on specific performance_schema tables. -# SETUP_INSTRUMENT : example of PFS_updatable_acl -# EVENTS_WAITS_CURRENT : example of PFS_truncatable_acl -# FILE_INSTANCES : example of PFS_readonly_acl +# setup_instrument : example of PFS_updatable_acl +# events_waits_current : example of PFS_truncatable_acl +# file_instances : example of PFS_readonly_acl --error ER_DBACCESS_DENIED_ERROR -grant ALL on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost +grant ALL on performance_schema.setup_instruments to 'pfs_user_3'@localhost with GRANT OPTION; # will be ER_DBACCESS_DENIED_ERROR once .FRM are removed -grant CREATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant CREATE on performance_schema.setup_instruments to 'pfs_user_3'@localhost; # will be ER_DBACCESS_DENIED_ERROR once .FRM are removed -grant DROP on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant DROP on performance_schema.setup_instruments to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant REFERENCES on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant REFERENCES on performance_schema.setup_instruments to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant INDEX on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant INDEX on performance_schema.setup_instruments to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant ALTER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant ALTER on performance_schema.setup_instruments to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant CREATE VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant CREATE VIEW on performance_schema.setup_instruments to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant SHOW VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant SHOW VIEW on performance_schema.setup_instruments to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant TRIGGER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant TRIGGER on performance_schema.setup_instruments to 'pfs_user_3'@localhost; ---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' --error ER_TABLEACCESS_DENIED_ERROR -grant INSERT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant INSERT on performance_schema.setup_instruments to 'pfs_user_3'@localhost; ---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' --error ER_TABLEACCESS_DENIED_ERROR -grant DELETE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant DELETE on performance_schema.setup_instruments to 'pfs_user_3'@localhost; -grant SELECT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost +grant SELECT on performance_schema.setup_instruments to 'pfs_user_3'@localhost with GRANT OPTION; -grant UPDATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost +grant UPDATE on performance_schema.setup_instruments to 'pfs_user_3'@localhost with GRANT OPTION; --error ER_DBACCESS_DENIED_ERROR -grant ALL on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost +grant ALL on performance_schema.events_waits_current to 'pfs_user_3'@localhost with GRANT OPTION; # will be ER_DBACCESS_DENIED_ERROR once .FRM are removed -grant CREATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant CREATE on performance_schema.events_waits_current to 'pfs_user_3'@localhost; # will be ER_DBACCESS_DENIED_ERROR once .FRM are removed -grant DROP on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant DROP on performance_schema.events_waits_current to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant REFERENCES on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant REFERENCES on performance_schema.events_waits_current to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant INDEX on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant INDEX on performance_schema.events_waits_current to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant ALTER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant ALTER on performance_schema.events_waits_current to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant CREATE VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant CREATE VIEW on performance_schema.events_waits_current to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant SHOW VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant SHOW VIEW on performance_schema.events_waits_current to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant TRIGGER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant TRIGGER on performance_schema.events_waits_current to 'pfs_user_3'@localhost; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' --error ER_TABLEACCESS_DENIED_ERROR -grant INSERT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant INSERT on performance_schema.events_waits_current to 'pfs_user_3'@localhost; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' --error ER_TABLEACCESS_DENIED_ERROR -grant UPDATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant UPDATE on performance_schema.events_waits_current to 'pfs_user_3'@localhost; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' --error ER_TABLEACCESS_DENIED_ERROR -grant DELETE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant DELETE on performance_schema.events_waits_current to 'pfs_user_3'@localhost; -grant SELECT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost +grant SELECT on performance_schema.events_waits_current to 'pfs_user_3'@localhost with GRANT OPTION; --error ER_DBACCESS_DENIED_ERROR -grant ALL on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost +grant ALL on performance_schema.file_instances to 'pfs_user_3'@localhost with GRANT OPTION; # will be ER_DBACCESS_DENIED_ERROR once .FRM are removed -grant CREATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant CREATE on performance_schema.file_instances to 'pfs_user_3'@localhost; # will be ER_DBACCESS_DENIED_ERROR once .FRM are removed -grant DROP on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant DROP on performance_schema.file_instances to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant REFERENCES on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant REFERENCES on performance_schema.file_instances to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant INDEX on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant INDEX on performance_schema.file_instances to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant ALTER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant ALTER on performance_schema.file_instances to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant CREATE VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant CREATE VIEW on performance_schema.file_instances to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant SHOW VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant SHOW VIEW on performance_schema.file_instances to 'pfs_user_3'@localhost; --error ER_DBACCESS_DENIED_ERROR -grant TRIGGER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant TRIGGER on performance_schema.file_instances to 'pfs_user_3'@localhost; ---replace_result '\'file_instances' '\'FILE_INSTANCES' --error ER_TABLEACCESS_DENIED_ERROR -grant INSERT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant INSERT on performance_schema.file_instances to 'pfs_user_3'@localhost; ---replace_result '\'file_instances' '\'FILE_INSTANCES' --error ER_TABLEACCESS_DENIED_ERROR -grant UPDATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant UPDATE on performance_schema.file_instances to 'pfs_user_3'@localhost; ---replace_result '\'file_instances' '\'FILE_INSTANCES' --error ER_TABLEACCESS_DENIED_ERROR -grant DELETE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant DELETE on performance_schema.file_instances to 'pfs_user_3'@localhost; -grant SELECT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost +grant SELECT on performance_schema.file_instances to 'pfs_user_3'@localhost with GRANT OPTION; # See bug#45354 LOCK TABLES is not a TABLE privilege @@ -258,25 +250,20 @@ CREATE user pfs_user_4; --connection pfs_user_4 --echo # Select as pfs_user_4 should fail without grant ---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' --error ER_TABLEACCESS_DENIED_ERROR -SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY; +SELECT event_id FROM performance_schema.events_waits_history; ---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' --error ER_TABLEACCESS_DENIED_ERROR -SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY_LONG; +SELECT event_id FROM performance_schema.events_waits_history_long; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' --error ER_TABLEACCESS_DENIED_ERROR -SELECT event_id FROM performance_schema.EVENTS_WAITS_CURRENT; +SELECT event_id FROM performance_schema.events_waits_current; ---replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' --error ER_TABLEACCESS_DENIED_ERROR -SELECT event_name FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +SELECT event_name FROM performance_schema.events_waits_summary_by_instance; ---replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' --error ER_TABLEACCESS_DENIED_ERROR -SELECT event_name FROM performance_schema.FILE_SUMMARY_BY_INSTANCE; +SELECT event_name FROM performance_schema.file_summary_by_instance; --echo # --echo # WL#4818, NFS3: Normal user does not have access to change what is @@ -287,35 +274,28 @@ SELECT event_name FROM performance_schema.FILE_SUMMARY_BY_INSTANCE; --echo # User pfs_user_4 should not be allowed to tweak instrumentation without --echo # explicit grant ---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' --error ER_TABLEACCESS_DENIED_ERROR -UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; +UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES'; ---replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' --error ER_TABLEACCESS_DENIED_ERROR -UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +UPDATE performance_schema.setup_instruments SET enabled = 'YES' WHERE name LIKE 'wait/synch/mutex/%' OR name LIKE 'wait/synch/rwlock/%'; ---replace_result '\'setup_consumers' '\'SETUP_CONSUMERS' --error ER_TABLEACCESS_DENIED_ERROR -UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; +UPDATE performance_schema.setup_consumers SET enabled = 'YES'; ---replace_result '\'setup_timers' '\'SETUP_TIMERS' --error ER_TABLEACCESS_DENIED_ERROR -UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK'; +UPDATE performance_schema.setup_timers SET timer_name = 'TICK'; ---replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' --error ER_TABLEACCESS_DENIED_ERROR -TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.events_waits_history_long; ---replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' --error ER_TABLEACCESS_DENIED_ERROR -TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.events_waits_history; ---replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' --error ER_TABLEACCESS_DENIED_ERROR -TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +TRUNCATE TABLE performance_schema.events_waits_current; --echo # --echo # WL#4814, NFS1: Can use grants to give normal user access @@ -325,29 +305,29 @@ TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; --connection default --echo # Grant access to change tables with the root account -GRANT UPDATE ON performance_schema.SETUP_CONSUMERS TO pfs_user_4; -GRANT UPDATE ON performance_schema.SETUP_TIMERS TO pfs_user_4; -GRANT UPDATE, SELECT ON performance_schema.SETUP_INSTRUMENTS TO pfs_user_4; -GRANT DROP ON performance_schema.EVENTS_WAITS_CURRENT TO pfs_user_4; -GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY TO pfs_user_4; -GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY_LONG TO pfs_user_4; +GRANT UPDATE ON performance_schema.setup_consumers TO pfs_user_4; +GRANT UPDATE ON performance_schema.setup_timers TO pfs_user_4; +GRANT UPDATE, SELECT ON performance_schema.setup_instruments TO pfs_user_4; +GRANT DROP ON performance_schema.events_waits_current TO pfs_user_4; +GRANT DROP ON performance_schema.events_waits_history TO pfs_user_4; +GRANT DROP ON performance_schema.events_waits_history_long TO pfs_user_4; --connection pfs_user_4 --echo # User pfs_user_4 should now be allowed to tweak instrumentation -UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; +UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES'; -UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +UPDATE performance_schema.setup_instruments SET enabled = 'YES' WHERE name LIKE 'wait/synch/mutex/%' OR name LIKE 'wait/synch/rwlock/%'; -UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; +UPDATE performance_schema.setup_consumers SET enabled = 'YES'; -UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK'; +UPDATE performance_schema.setup_timers SET timer_name = 'TICK'; -TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; -TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; -TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +TRUNCATE TABLE performance_schema.events_waits_history_long; +TRUNCATE TABLE performance_schema.events_waits_history; +TRUNCATE TABLE performance_schema.events_waits_current; --echo # Clean up --disconnect pfs_user_4 @@ -356,7 +336,7 @@ TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4; DROP USER pfs_user_4; flush privileges; -UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES'; -UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; -UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE'; +UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES'; +UPDATE performance_schema.setup_consumers SET enabled = 'YES'; +UPDATE performance_schema.setup_timers SET timer_name = 'CYCLE'; |