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

REVOKE ALL PRIVILEGES, GRANT OPTION FROM <role> fails with ER_NONEXISTING_GRANT (1141) when a granted role holds database privileges the grantee doesn't hold directly

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      Test case:
      CREATE DATABASE db1;
      CREATE DATABASE db2;
      CREATE ROLE child;
      GRANT SELECT ON db2.* TO child;
      CREATE ROLE parent;
      GRANT SELECT ON db1.* TO parent;
      GRANT child TO parent;
      REVOKE ALL PRIVILEGES, GRANT OPTION FROM parent;
      SHOW WARNINGS;
      SHOW GRANTS FOR parent;

      Actual result:
      ERROR 1141 (42000): There is no such grant defined for user 'parent' on host ''

      SHOW WARNINGS:

      Error 1141 There is no such grant defined for user 'parent' on host ''
      Error 1141 There is no such grant defined for user 'parent' on host ''
      Error 1269 Can't revoke all privileges for one or more of the requested users

      SHOW GRANTS FOR parent:
      GRANT USAGE ON . TO `parent`

      Expected result: The statement succeeds with no error. As SHOW GRANTS shows, every privilege and the role grant are in fact revoked; only the error is spurious.

      This is similar to MDEV-5228 but the focus on that ticket seems to be the wording of the error and it's been stuck for a while.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            psumner Phil Sumner
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.