ClickHouse/tests/queries/0_stateless/01073_grant_and_revoke.sql
Ivan 97f2a2213e
Move all folders inside /dbms one level up (#9974)
* Move some code outside dbms/src folder
* Fix paths
2020-04-02 02:51:21 +03:00

29 lines
788 B
SQL

DROP USER IF EXISTS test_user_01073;
CREATE USER test_user_01073;
SHOW CREATE USER test_user_01073;
SELECT 'A';
SHOW GRANTS FOR test_user_01073;
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;
SELECT 'B';
SHOW GRANTS FOR test_user_01073;
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;
SELECT 'C';
SHOW GRANTS FOR test_user_01073;
DROP USER test_user_01073;