[MDEV-17999] Possibly misplaced [ERROR] Invalid roles_mapping table entry user for a role with non-existing admin Created: 2018-12-13  Updated: 2023-04-27

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

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Unresolved Votes: 0
Labels: None


 Description   

10.4 4abb8216a054e14afbeb81e8529e02bab6fa14ac

MariaDB [test]> CREATE ROLE r WITH ADMIN u;
Query OK, 0 rows affected, 1 warning (0.02 sec)
 
MariaDB [test]> show warnings;
+-------+------+----------------------------------------------------------+
| Level | Code | Message                                                  |
+-------+------+----------------------------------------------------------+
| Note  | 1449 | The user specified as a definer ('u'@'%') does not exist |
+-------+------+----------------------------------------------------------+
1 row in set (0.00 sec)
 
MariaDB [test]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

So, the first statement (CREATE) succeeds, even although with the warning, and the role is created. The error log is clean at this point.
The second statement (FLUSH) also succeeds, and even without warnings, but upon it an error appears in the error log:

[ERROR] Invalid roles_mapping table entry user:'u@%', rolename:'r'

It seems inconsistent. If the entry is indeed so invalid it deserves an error, it probably shouldn't be created. If it's worrisome but not really invalid, it should be a warning. And if FLUSH PRIVILEGES encounters an invalid record, it should produce an SQL warning or error, not just a log record.


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