2020-02-04 01:15:14 +00:00
|
|
|
DROP USER IF EXISTS test_user_01073;
|
2021-11-10 13:51:44 +00:00
|
|
|
DROP ROLE IF EXISTS test_role_01073;
|
2020-02-04 01:15:14 +00:00
|
|
|
|
2021-11-10 13:51:44 +00:00
|
|
|
SELECT 'A';
|
2020-02-04 01:15:14 +00:00
|
|
|
CREATE USER test_user_01073;
|
|
|
|
SHOW CREATE USER test_user_01073;
|
|
|
|
|
2021-11-10 13:51:44 +00:00
|
|
|
SELECT 'B';
|
2020-02-04 01:15:14 +00:00
|
|
|
SHOW GRANTS FOR test_user_01073;
|
|
|
|
|
2021-11-10 13:51:44 +00:00
|
|
|
SELECT 'C';
|
2020-02-04 01:15:14 +00:00
|
|
|
GRANT SELECT ON db1.* TO test_user_01073;
|
|
|
|
GRANT SELECT ON db2.table TO test_user_01073;
|
|
|
|
GRANT SELECT(col1) ON db3.table TO test_user_01073;
|
|
|
|
GRANT SELECT(col1, col2) ON db4.table TO test_user_01073;
|
|
|
|
GRANT INSERT ON *.* TO test_user_01073;
|
|
|
|
GRANT DELETE ON *.* TO test_user_01073;
|
|
|
|
SHOW GRANTS FOR test_user_01073;
|
|
|
|
|
2021-11-10 13:51:44 +00:00
|
|
|
SELECT 'D';
|
2020-02-04 01:15:14 +00:00
|
|
|
REVOKE SELECT ON db1.* FROM test_user_01073;
|
|
|
|
REVOKE SELECT ON db2.table FROM test_user_01073;
|
|
|
|
REVOKE SELECT ON db3.table FROM test_user_01073;
|
|
|
|
REVOKE SELECT(col2) ON db4.table FROM test_user_01073;
|
|
|
|
REVOKE INSERT ON *.* FROM test_user_01073;
|
|
|
|
SHOW GRANTS FOR test_user_01073;
|
|
|
|
|
2021-11-10 13:51:44 +00:00
|
|
|
SELECT 'E';
|
|
|
|
CREATE ROLE test_role_01073;
|
|
|
|
GRANT SELECT ON db1.* TO test_role_01073;
|
|
|
|
REVOKE SELECT(c1, c2, c3, c4, c5) ON db1.table1 FROM test_role_01073;
|
|
|
|
REVOKE SELECT(c1) ON db1.table2 FROM test_role_01073;
|
|
|
|
SHOW GRANTS FOR test_role_01073;
|
|
|
|
|
2020-02-04 01:15:14 +00:00
|
|
|
DROP USER test_user_01073;
|
2021-11-10 13:51:44 +00:00
|
|
|
DROP ROLE test_role_01073;
|