mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
add tests
This commit is contained in:
parent
1723a522cc
commit
08101af4fd
16
tests/queries/0_stateless/01999_grant_by_replace.reference
Normal file
16
tests/queries/0_stateless/01999_grant_by_replace.reference
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
CREATE USER test_user_01999
|
||||||
|
A
|
||||||
|
B
|
||||||
|
GRANT SELECT ON db1.* TO test_user_01999
|
||||||
|
GRANT SHOW TABLES, SHOW COLUMNS, SHOW DICTIONARIES ON db2.table TO test_user_01999
|
||||||
|
C
|
||||||
|
GRANT SELECT(col1) ON db3.table TO test_user_01999
|
||||||
|
D
|
||||||
|
GRANT SELECT(col3) ON db3.table3 TO test_user_01999
|
||||||
|
GRANT SELECT(col1, col2) ON db4.table4 TO test_user_01999
|
||||||
|
E
|
||||||
|
GRANT SELECT(cola) ON db5.table TO test_user_01999
|
||||||
|
GRANT INSERT(colb) ON db6.tb61 TO test_user_01999
|
||||||
|
GRANT SHOW ON db7.* TO test_user_01999
|
||||||
|
F
|
||||||
|
GRANT SELECT ON all.* TO test_user_01999
|
35
tests/queries/0_stateless/01999_grant_by_replace.sql
Normal file
35
tests/queries/0_stateless/01999_grant_by_replace.sql
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
DROP USER IF EXISTS test_user_01999;
|
||||||
|
|
||||||
|
CREATE USER test_user_01999;
|
||||||
|
SHOW CREATE USER test_user_01999;
|
||||||
|
|
||||||
|
SELECT 'A';
|
||||||
|
SHOW GRANTS FOR test_user_01999;
|
||||||
|
|
||||||
|
GRANT SELECT ON db1.* TO test_user_01999;
|
||||||
|
GRANT SHOW ON db2.table TO test_user_01999;
|
||||||
|
|
||||||
|
SELECT 'B';
|
||||||
|
SHOW GRANTS FOR test_user_01999;
|
||||||
|
|
||||||
|
GRANT BY REPLACE SELECT(col1) ON db3.table TO test_user_01999;
|
||||||
|
|
||||||
|
SELECT 'C';
|
||||||
|
SHOW GRANTS FOR test_user_01999;
|
||||||
|
|
||||||
|
GRANT BY REPLACE SELECT(col3) ON db3.table3, SELECT(col1, col2) ON db4.table4 TO test_user_01999;
|
||||||
|
|
||||||
|
SELECT 'D';
|
||||||
|
SHOW GRANTS FOR test_user_01999;
|
||||||
|
|
||||||
|
GRANT BY REPLACE SELECT(cola) ON db5.table, INSERT(colb) ON db6.tb61, SHOW ON db7.* TO test_user_01999;
|
||||||
|
|
||||||
|
SELECT 'E';
|
||||||
|
SHOW GRANTS FOR test_user_01999;
|
||||||
|
|
||||||
|
SELECT 'F';
|
||||||
|
GRANT BY REPLACE SELECT ON all.* TO test_user_01999;
|
||||||
|
SHOW GRANTS FOR test_user_01999;
|
||||||
|
|
||||||
|
DROP USER test_user_01999;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user