Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17999

Possibly misplaced [ERROR] Invalid roles_mapping table entry user for a role with non-existing admin

    XMLWordPrintable

Details

    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.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.