ClickHouse/dbms/tests/queries/0_stateless/01073_grant_and_revoke.sql
Vitaly Baranov 3706b9d92a Add tests.
2020-02-06 18:12:53 +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;