[MDEV-5237] Minor inconsistency between current_role and I_S.enabled_roles Created: 2013-11-04  Updated: 2013-11-04  Resolved: 2013-11-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Trivial
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-4397 Roles Closed
relates to MDEV-5164 Testing Roles Closed

 Description   

I suppose I_S.ENABLED_ROLES should return at least the same as CURRENT_ROLE, but in fact it's not always so.

--error 0,ER_CANNOT_USER
drop role r1;
 
create role r1;
set role r1;
 
select current_role();
select * from information_schema.enabled_roles;
 
drop role r1;
 
select current_role();
select * from information_schema.enabled_roles;

After the role is dropped, current_role() still returns the name of the dropped role, while I_S.enabled_roles contains NULL:

drop role r1;
select current_role();
current_role()
r1
select * from information_schema.enabled_roles;
ROLE_NAME
NULL

Since current_role behavior is the same as for current_user (if the user is dropped, current_user for an open session still returns the name), I guess I_S.enabled_roles should do the same.



 Comments   
Comment by Elena Stepanova [ 2013-11-04 ]

As discussed, it works the same way for current_user vs I_S.user_privileges, so it can be considered either not a bug at all, or something not worth fixing. Closing as such.

Generated at Thu Feb 08 07:02:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.