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

Wrong user in SET DEFAULT ROLE error

Details

    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

            Transition Time In Source Status Execution Times
            Daniel Black made transition -
            Stalled In Testing
            8d 7h 54m 1
            Anel Husakovic made transition -
            In Testing Stalled
            4d 4h 42m 1
            Anel Husakovic made transition -
            Stalled Open
            49d 14h 10m 1
            Anel Husakovic made transition -
            Open Confirmed
            180d 10h 12m 2
            Anel Husakovic made transition -
            Confirmed In Review
            1m 6s 2
            Anel Husakovic made transition -
            Stalled In Progress
            29d 14h 20m 1
            Anel Husakovic made transition -
            In Progress In Review
            3d 6h 40m 1
            Anel Husakovic made transition -
            Stalled In Review
            41d 12h 49m 3
            Sergei Golubchik made transition -
            In Review Stalled
            419d 23h 58m 6
            Anel Husakovic made transition -
            Stalled Closed
            2d 9h 59m 1

            People

              anel Anel Husakovic
              markus makela markus makela
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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