You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
user_grant_10 role_account_priv_9 table table all d.*
281
284
insert into testdb4.table_1 values (10,'ccc',1.8),(11,'ddd',5.3);
282
-
internal error: do not have privilege to execute the statement
283
285
select * from testdb4.table_1;
284
-
internal error: do not have privilege to execute the statement
286
+
id name num
287
+
10 ccc 1.8
288
+
11 ddd 5.3
285
289
update testdb4.table_1 set name='oppo' where id=10;
286
-
internal error: do not have privilege to execute the statement
287
290
delete from testdb4.table_1;
288
291
select * from testdb4.table_1;
289
292
internal error: do not have privilege to execute the statement
@@ -334,8 +337,7 @@ grant r1,r2,r3,r4,r5 to user1,user2,user3,user4,user5;
334
337
select count(*) from mo_catalog.mo_user_grant,mo_catalog.mo_user,mo_catalog.mo_role_privs where mo_user_grant.user_id=mo_user.user_id and mo_role_privs.role_id=mo_user_grant.role_id and role_name in ('r1','r2','r3','r4','r5');
335
338
count(*)
336
339
99
337
-
create table grant_table_10(a int);
338
-
internal error: do not have privilege to execute the statement
340
+
create table testdb5.grant_table_10(a int);
339
341
grant create role on account * to r5;
340
342
grant r5 to user1,user2,user3,user4,user5;
341
343
select user_name,role_name,obj_type,privilege_name,privilege_level from mo_catalog.mo_user_grant,mo_catalog.mo_user,mo_catalog.mo_role_privs where mo_user_grant.user_id=mo_user.user_id and mo_role_privs.role_id=mo_user_grant.role_id and role_name in ('r5');
@@ -365,30 +367,32 @@ user5 r5 table insert *.*
365
367
user5 r5 table update *.*
366
368
user5 r5 database create table *.*
367
369
user5 r5 account create role *
368
-
create role test_role;
369
-
internal error: do not have privilege to execute the statement
370
-
select count(*) from mo_catalog.mo_role where role_name='test_role';
371
-
internal error: do not have privilege to execute the statement
370
+
create role test_role_2;
371
+
select count(*) from mo_catalog.mo_role where role_name='test_role_2';
372
+
count(*)
373
+
1
372
374
create user user11 identified by '12345678';
373
375
grant select ,insert ,update on table *.* to r1,r2 with grant option;
374
376
grant r1,r2 to r6,r7;
375
377
select mr.role_name,mp.role_name,obj_type,privilege_name,privilege_level from mo_catalog.mo_role_grant mg,mo_catalog.mo_role mr ,mo_catalog.mo_role_privs mp where mg.grantee_id=mr.role_id and mg.granted_id = mp.role_id and mr.role_name in ('r6','r7');
select user_name,role_name,obj_type,privilege_name,privilege_level from mo_catalog.mo_user_grant,mo_catalog.mo_user,mo_catalog.mo_role_privs where mo_user_grant.user_id=mo_user.user_id and mo_role_privs.role_id=mo_user_grant.role_id and user_name in ('user1','user2') and role_name in ('r1','r2');
select mr.role_name,mp.role_name,obj_type,privilege_name,privilege_level from mo_catalog.mo_role_grant mg,mo_catalog.mo_role mr ,mo_catalog.mo_role_privs mp where mg.grantee_id=mr.role_id and mg.granted_id = mp.role_id and mr.role_name in ('r6','r7');
drop user if exists user1,user2,user3,user4,user5,user11,user12,testuser,user_grant_1,user_grant_3,user_grant_4,user_grant_5,user_grant_6,user_grant_7,user_grant_8,user_grant_9,user_grant_10,user_prepare_01;
450
-
drop role if exists u_role,test_role,grant_role_1,role_sys_priv,role_account_priv_2,role_account_priv_3,role_account_priv_4,role_account_priv_5,role_account_priv_6,role_account_priv_7,role_account_priv_8,role_account_priv_9,role_account_priv_10,role_prepare_1;
459
+
drop role if exists u_role,test_role,test_role_2,grant_role_1,role_sys_priv,role_account_priv_2,role_account_priv_3,role_account_priv_4,role_account_priv_5,role_account_priv_6,role_account_priv_7,role_account_priv_8,role_account_priv_9,role_account_priv_10,role_prepare_1;
Copy file name to clipboardExpand all lines: test/distributed/cases/zz_accesscontrol/grant_privs_role.sql
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -253,16 +253,16 @@ create user user1 identified by '12345678',user2 identified by '12345678',user3
253
253
grant r1,r2,r3,r4,r5 to user1,user2,user3,user4,user5;
254
254
selectcount(*) frommo_catalog.mo_user_grant,mo_catalog.mo_user,mo_catalog.mo_role_privswheremo_user_grant.user_id=mo_user.user_idandmo_role_privs.role_id=mo_user_grant.role_idand role_name in ('r1','r2','r3','r4','r5');
dropuser if exists user1,user2,user3,user4,user5,user11,user12,testuser,user_grant_1,user_grant_3,user_grant_4,user_grant_5,user_grant_6,user_grant_7,user_grant_8,user_grant_9,user_grant_10,user_prepare_01;
291
-
drop role if exists u_role,test_role,grant_role_1,role_sys_priv,role_account_priv_2,role_account_priv_3,role_account_priv_4,role_account_priv_5,role_account_priv_6,role_account_priv_7,role_account_priv_8,role_account_priv_9,role_account_priv_10,role_prepare_1;
291
+
drop role if exists u_role,test_role,test_role_2,grant_role_1,role_sys_priv,role_account_priv_2,role_account_priv_3,role_account_priv_4,role_account_priv_5,role_account_priv_6,role_account_priv_7,role_account_priv_8,role_account_priv_9,role_account_priv_10,role_prepare_1;
0 commit comments