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

Wrong user in SET DEFAULT ROLE error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: In Review (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.5.12
    • Fix Version/s: 10.5, 10.6
    • Component/s: None
    • Labels:
      None

      Description

      The error message for SET DEFAULT ROLE refers to the user performing the operation instead of the target user. This is misleading as the user giving the grant doesn't require the grant itself, only the target user.

      Here's an example (and a test case) that reproduces the problem:

      MariaDB [test]> create role test_role;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> create user test_user;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> set default role test_role for test_user;
      ERROR 1959 (OP000): User `maxuser`@`127.0.0.1` has not been granted role `test_role`
      MariaDB [test]> grant test_role to maxuser@127.0.0.1;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> set default role test_role for test_user;
      ERROR 1959 (OP000): User `maxuser`@`127.0.0.1` has not been granted role `test_role`
      MariaDB [test]> grant test_role to test_user;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> set default role test_role for test_user;
      Query OK, 0 rows affected (0.000 sec)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              markus makela markus makela
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration