add tests

This commit is contained in:
caspian 2021-07-16 11:21:50 +08:00
parent 1723a522cc
commit 08101af4fd
2 changed files with 51 additions and 0 deletions

View 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

View 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;