[MDEV-8616] Inconsistent behavior of GRANT/REVOKE PROXY with roles Created: 2015-08-14  Updated: 2022-09-08

Status: Open
Project: MariaDB Server
Component/s: Admin statements
Affects Version/s: 10.0, 10.1
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Vicențiu Ciorbaru
Resolution: Unresolved Votes: 0
Labels: None

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

 Description   

prepare entries

create user u1;
create user u2;
create role r1;
create role r2;

User logic: all of these work

grant proxy on u1 to u2;
grant proxy on u1 to CURRENT_USER;
grant proxy on CURRENT_USER to u2;

Roles logic

set role r1;

Granting PROXY to a role

# This does not work: a role cannot be granted proxy on a user
# (returns ERROR 1133 Can't find any matching row in the user table)
grant proxy on u1 to r1;
 
# This also does not work, same error, so it's consistent with the previous one
# (also returns ERROR 1133 Can't find any matching row in the user table)
grant proxy on u1 to CURRENT_ROLE;

Granting PROXY on a role

# This works (I'm not sure it should, but it does): a user can be granted proxy on a role
grant proxy on r1 to u2;
 
# But this returns a syntax error
grant proxy on CURRENT_ROLE to u1;

Last two results are inconsistent. If a user can be granted proxy on a role, it should work for CURRENT_ROLE as well.
If a user cannot be granted proxy on a role, the first statement should return a proper error (and preferably the second one too, but it would be less important then, it can stay a syntax error).


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