Skip to content

Commit 844ecdf

Browse files
authored
Merge pull request #10705 from TCeason/add_more_test_for_priv
ci(query): add more test for grant privileges
2 parents d73fde3 + d13e72a commit 844ecdf

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/sqllogictests/suites/base/05_ddl/05_0006_ddl_grant_privilege

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,40 @@ GRANT SELECT ON db01.tbnotexists TO 'test-grant'@'localhost'
4646
statement error 1003
4747
GRANT SELECT ON dbnotexists.* TO 'test-grant'@'localhost'
4848

49+
onlyif mysql
50+
query T
51+
select current_user()
52+
----
53+
'root'@'127.0.0.1'
54+
55+
onlyif mysql
56+
statement ok
57+
set role 'public';
58+
59+
onlyif mysql
60+
query T
61+
select current_role()
62+
----
63+
public
64+
65+
onlyif mysql
66+
query T
67+
show roles
68+
----
69+
account_admin 0 0 1
70+
public 0 1 0
71+
72+
query T
73+
show grants for role 'public'
74+
----
75+
GRANT SELECT ON 'default'.'system'.'one' TO 'public'
76+
77+
query T
78+
show grants for role 'account_admin'
79+
----
80+
GRANT ALL ON *.* TO 'account_admin'
81+
GRANT SELECT ON 'default'.'system'.'one' TO 'account_admin'
82+
4983
query T
5084
SHOW GRANTS FOR 'test-grant'@'localhost'
5185
----

0 commit comments

Comments
 (0)