Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.44, 10.2.31, 10.3.22, 10.4.12, 10.5.2
-
None
Description
Let's say that we create a role and a user account:
MariaDB [(none)]> CREATE ROLE 'test_role'; |
Query OK, 0 rows affected (0.004 sec) |
|
MariaDB [(none)]> CREATE USER 'test_user'@'%'; |
Query OK, 0 rows affected (0.004 sec) |
If we try to set this role to the user's default role without first granting the role to the user, then we see this error message:
MariaDB [(none)]> SET DEFAULT ROLE 'test_role' FOR 'test_user'@'%'; |
ERROR 1959 (OP000): Invalid role specification `test_role`
|
This "Invalid role specification" error message is incorrect. It would be more accurate to say something like this:
User `test_user`@`%` has not been granted role `test_role`
Obviously, if we grant the role to the user before executing SET DEFAULT ROLE, then everything works fine:
MariaDB [(none)]> GRANT 'test_role' TO 'test_user'@'%'; |
Query OK, 0 rows affected (0.004 sec) |
|
MariaDB [(none)]> SET DEFAULT ROLE 'test_role' FOR 'test_user'@'%'; |
Query OK, 0 rows affected (0.004 sec) |
Attachments
Issue Links
- causes
-
MDEV-26081 set role crashes when a hostname cannot be resolved
- Closed
- relates to
-
MDEV-20434 ALTER USER prints bad error message if specified authentication plugin is not loaded
- Open
-
MDEV-20435 ALTER USER prints bad error message if specified user account does not exist
- Open
-
MDEV-22313 SHOW GRANTS does not prints a user's default role
- Closed
-
MDEV-22311 implement SHOW CREATE ROLE
- Open
-
MDEV-26875 Wrong user in SET DEFAULT ROLE error
- Closed