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

Extend CREATE TEMPORARY TABLES privilege to allow temp table operations

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 5.5.32
    • Fix Version/s: 5.5.33
    • Component/s: None
    • Labels:
      None

      Description

      This is actually a known MySQL bug (1), but I didn't find a report for MariaDB, which is behaving the same. What's more, it was fixed for MySQL 5.6, but they didn't back-port the fix to 5.5 and 5.1, which is a pity. If you could try to look at possible back-porting into that versions at least in MariaDB, that would be great.

      For the case MySQL bug report vanishes in the future, this is what is wrong:
      When we grant CREATE TEMPORARY TABLES privileges for a user, he won't be able to do anything with the table actually.

      Reproducer:

      $ mysql -u root
      mysql> CREATE USER temp_priv_user;
      mysql> CREATE DATABASE temp_priv;
      mysql> GRANT CREATE TEMPORARY TABLES ON temp_priv.* TO temp_priv_user@localhost;

      $ mysql -u temp_priv_user temp_priv
      mysql> CREATE TEMPORARY TABLE tmp1(a INT);
      mysql> INSERT INTO tmp1 VALUES (11), (12), (13);

      Actual results:

      ERROR 1142 (42000): INSERT command denied to user 'temp_priv_user'@'localhost' for table 'tmp1'

      Expected results:
      rows are inserted

      (1) http://bugs.mysql.com/bug.php?id=27480

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              elenst Elena Stepanova added a comment -

              If it's implemented in MySQL 5.6, it will eventually be merged into 10.x.
              In regard to 5.5, I'm not sure it's a right thing to do to make such a change in a post-GA version (that's exactly why MySQL didn't do it in 5.5), but I'll pass it to Sergei for a verdict.

              Show
              elenst Elena Stepanova added a comment - If it's implemented in MySQL 5.6, it will eventually be merged into 10.x. In regard to 5.5, I'm not sure it's a right thing to do to make such a change in a post-GA version (that's exactly why MySQL didn't do it in 5.5), but I'll pass it to Sergei for a verdict.
              Hide
              serg Sergei Golubchik added a comment -

              it's not really a bug, MySQL and MariaDB up to 5.5 behave as intended and documented.

              I agree that this intentional behavior was not particularly useful and intuitive, and that's why it was fixed in MySQL 5.6 and in 10.0.4. But it's a new feature, and code changes are significant. We cannot do it in 5.5.

              Show
              serg Sergei Golubchik added a comment - it's not really a bug, MySQL and MariaDB up to 5.5 behave as intended and documented. I agree that this intentional behavior was not particularly useful and intuitive, and that's why it was fixed in MySQL 5.6 and in 10.0.4. But it's a new feature, and code changes are significant. We cannot do it in 5.5.
              Hide
              hhorak Honza Horak added a comment -

              Understood and agreed. Thanks for that explanation.

              Show
              hhorak Honza Horak added a comment - Understood and agreed. Thanks for that explanation.

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  hhorak Honza Horak
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: