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

SHOW EVENTS in performance_schema gives Access Denied

Details

    Description

      Description:
      Executing SHOW EVENTS on performance_schema returns an Access denied error, even if the user is root.
      Perhaps the command should return an empty result set instead.

      How to repeat:

      MariaDB [(none)]> use performance_schema;
      Reading table information for completion of table and column names
      You can turn off this feature to get a quicker startup with -A
       
      Database changed
      MariaDB [performance_schema]> show grants;
      +----------------------------------------------------------------------------------------------------------------------------------------+
      | Grants for root@localhost                                                                                                              |
      +----------------------------------------------------------------------------------------------------------------------------------------+
      | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*****************************************' WITH GRANT OPTION |
      | GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           |
      +----------------------------------------------------------------------------------------------------------------------------------------+
      2 rows in set (0.00 sec)
       
      MariaDB [performance_schema]> show events;
      ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'performance_schema'
      

      Attachments

        Activity

          Thanks for the report.

          Reproducible on all of MariaDB 5.5-10.3, MySQL 5.5-5.6. Not reproducible on MySQL 5.7, apparently fixed in scope of https://bugs.mysql.com/bug.php?id=73082.

          elenst Elena Stepanova added a comment - Thanks for the report. Reproducible on all of MariaDB 5.5-10.3, MySQL 5.5-5.6. Not reproducible on MySQL 5.7, apparently fixed in scope of https://bugs.mysql.com/bug.php?id=73082 .

          This is not a bug. One of the differences between SHOW commands and queries on information_schema tables — SHOW commands check privileges up front and fail with an error, while information_schema tables only omit rows, presenting an empty result set. For example:

          MariaDB [test]> show tables from mysql;
          ERROR 1044 (42000): Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
          MariaDB [test]> select * from information_schema.tables where table_schema='mysql';
          Empty set (0.00 sec)
          

          One needs to have EVENT privilege to see events. Nobody has this privilege on performance_schema, not even the root user. So SHOW EVENTS rightfully fails there. And informartion_schema.events displays no rows (rightfully, too).

          serg Sergei Golubchik added a comment - This is not a bug. One of the differences between SHOW commands and queries on information_schema tables — SHOW commands check privileges up front and fail with an error, while information_schema tables only omit rows, presenting an empty result set. For example: MariaDB [test]> show tables from mysql; ERROR 1044 (42000): Access denied for user 'mysqltest_1' @ 'localhost' to database 'mysql' MariaDB [test]> select * from information_schema.tables where table_schema= 'mysql' ; Empty set (0.00 sec) One needs to have EVENT privilege to see events. Nobody has this privilege on performance_schema , not even the root user. So SHOW EVENTS rightfully fails there. And informartion_schema.events displays no rows (rightfully, too).

          People

            serg Sergei Golubchik
            kallehk Karl Håkansson
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.