[MDEV-4818] Extend CREATE TEMPORARY TABLES privilege to allow temp table operations Created: 2013-07-26  Updated: 2013-08-08  Resolved: 2013-08-08

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.32
Fix Version/s: 5.5.33

Type: Bug Priority: Major
Reporter: Honza Horak Assignee: Sergei Golubchik
Resolution: Won't Fix Votes: 0
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



 Comments   
Comment by Elena Stepanova [ 2013-07-27 ]

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.

Comment by Sergei Golubchik [ 2013-08-08 ]

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.

Comment by Honza Horak [ 2013-08-08 ]

Understood and agreed. Thanks for that explanation.

Generated at Thu Feb 08 06:59:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.