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

Wrong user in SET DEFAULT ROLE error

    XMLWordPrintable

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

            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.