Debian Codegraph @

mysql-test/suite/perfschema/t/keyring_keys_privileges.test

raw
1 ###########################################################################
2 # Test Author : Mohit Joshi #
3 # Creation Date : 30-Nov-2018 #
4 # WL#11543 : Instrument the keyring into performance schema #
5 # Test Objective: To verify that only users with permissions to query the #
6 # performance schema can access the keyring_keys table. #
7 ###########################################################################
8
9 CREATE USER happygilmore@localhost identified by 'happy';
10 GRANT SELECT ON *.* TO happygilmore@localhost;
11
12 --connect (con1,localhost,happygilmore,happy,test)
13 --connection con1
14 SHOW GRANTS;
15 SELECT * FROM performance_schema.keyring_keys;
16
17 --connection default
18 REVOKE SELECT ON *.* FROM happygilmore@localhost;
19 --disconnect con1
20
21 --connect (con1,localhost,happygilmore,happy,test)
22 --connection con1
23 SHOW GRANTS;
24 # Due to no SELECT privilege on the user, SELECT operation MUST fail.
25 --error ER_TABLEACCESS_DENIED_ERROR
26 SELECT * FROM performance_schema.keyring_keys;
27
28 --connection default
29 GRANT SELECT ON *.* TO happygilmore@localhost;
30 --disconnect con1
31
32 --connect (con1,localhost,happygilmore,happy,test)
33 --connection con1
34 SHOW GRANTS;
35 # Query must execute successfully after giving SELECT privilege to the user.
36 SELECT * FROM performance_schema.keyring_keys;
37
38 --connection default
39 DROP USER happygilmore@localhost;
40 --disconnect con1