[MDEV-27478] Misleading error message for SET DEFAULT ROLE Created: 2022-01-12  Updated: 2022-01-12  Resolved: 2022-01-12

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Karl Levik Assignee: Sergei Golubchik
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-26875 Wrong user in SET DEFAULT ROLE error Closed

 Description   

CREATE USER u@'%' IDENTIFIED BY '123';
CREATE ROLE r;
SET DEFAULT ROLE r FOR u@'%';

Yields:

ERROR 1959 (OP000): User `root`@`localhost` has not been granted role `r`

... when really the problem is a missing grant for user `u` before trying to set the default role:

GRANT r TO u;

So therefore the error message ought to say something like this instead:

User `u`@`%` has not been granted role `r`

I think this behaviour is seen in all versions.



 Comments   
Comment by Sergei Golubchik [ 2022-01-12 ]

please see MDEV-26875

Generated at Thu Feb 08 09:53:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.