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

Incorrect message test on a failed attempt to revoke grants from a role

Details

    Description

      The message incorrectly identifies the entity as a user, while it is a role:

      MariaDB [test]> create role foo;
      Query OK, 0 rows affected (0.01 sec)
       
      MariaDB [test]> revoke all on bar.* from foo;
      ERROR 1141 (42000): There is no such grant defined for user 'foo' on host ''

      Since other errors seem to be able to distinguish between a user and a role, it might make sense fix this one too.

      Attachments

        Issue Links

          Activity

            ip1981 Igor Pashev added a comment - - edited

            REVOKE ALL, GRANT OPTION FROM <role>; also fails if the <role> has no privileges granted.

            ip1981 Igor Pashev added a comment - - edited REVOKE ALL, GRANT OPTION FROM <role>; also fails if the <role> has no privileges granted.
            ip1981 Igor Pashev added a comment -

            It's even more complicated:

            MariaDB [mysql]> create role role1;
            Query OK, 0 rows affected (0.01 sec)
             
            MariaDB [mysql]> grant select on mysql.user to role1;
            Query OK, 0 rows affected (0.01 sec)
             
            MariaDB [mysql]> create role role2;
            Query OK, 0 rows affected (0.00 sec)
             
            MariaDB [mysql]> grant role1 to role2;
            Query OK, 0 rows affected (0.00 sec)
             
            MariaDB [mysql]> revoke all, grant option from role2;
            ERROR 1147 (42000): There is no such grant defined for user 'role2' on host '' on table 'user'
            Error (Code 1147): There is no such grant defined for user 'role2' on host '' on table 'user'
            Error (Code 1269): Can't revoke all privileges for one or more of the requested users
            MariaDB [mysql]> show grants for role2;
            +-------------------------------+
            | Grants for role2              |
            +-------------------------------+
            | GRANT USAGE ON *.* TO 'role2' |
            +-------------------------------+
            
            

            ip1981 Igor Pashev added a comment - It's even more complicated: MariaDB [mysql]> create role role1; Query OK, 0 rows affected (0.01 sec)   MariaDB [mysql]> grant select on mysql.user to role1; Query OK, 0 rows affected (0.01 sec)   MariaDB [mysql]> create role role2; Query OK, 0 rows affected (0.00 sec)   MariaDB [mysql]> grant role1 to role2; Query OK, 0 rows affected (0.00 sec)   MariaDB [mysql]> revoke all, grant option from role2; ERROR 1147 (42000): There is no such grant defined for user 'role2' on host '' on table 'user' Error (Code 1147): There is no such grant defined for user 'role2' on host '' on table 'user' Error (Code 1269): Can't revoke all privileges for one or more of the requested users MariaDB [mysql]> show grants for role2; +-------------------------------+ | Grants for role2 | +-------------------------------+ | GRANT USAGE ON *.* TO 'role2' | +-------------------------------+

            Fix for the issue submitted in https://github.com/MariaDB/server/pull/3114

            nickothieno Nicholas Othieno added a comment - Fix for the issue submitted in https://github.com/MariaDB/server/pull/3114

            People

              cvicentiu Vicențiu Ciorbaru
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              6 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.