[MDEV-12790] Invalid role error message is not descriptive if you were trying to add grants Created: 2017-05-12  Updated: 2020-12-01

Status: Confirmed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: 10.0, 10.1, 10.2
Fix Version/s: 10.2

Type: Bug Priority: Minor
Reporter: Michaël de groot Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None


 Description   

Hi,

When trying to add grants (GRANT SUPER ON *.*) but forgetting the *.* I get an error about invalid roles:

MariaDB [mysql]> grant super to 'user'@'host';
ERROR 1959 (OP000): Invalid role specification `super`.

This is not very descriptive. In my opinion, this would be better:

ERROR 1959 (OP000): Invalid role specification `super`. Perhaps you meant to grant a permission ON database.table or *.*?



 Comments   
Comment by Elena Stepanova [ 2017-05-12 ]

That would be a wild guess. super is a valid name for a role, the only problem is that you don't have it defined.

MariaDB [test]> create role super;
Query OK, 0 rows affected (0.01 sec)
 
MariaDB [test]> grant super to root@localhost;
Query OK, 0 rows affected (0.00 sec)

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