Bug #42540 SELECT,INSERT ... command denied to usual user for TEMPORARY table
Submitted: 2 Feb 2009 11:34 Modified: 2 Feb 2009 12:14
Reporter: mysql2006@mail.ru mysql2006@mail.ru Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: Security: Privileges Severity:S3 (Non-critical)
Version:6.0.9 OS:Any
Assigned to: CPU Architecture:Any
Tags: access denied, temporary table

[2 Feb 2009 11:34] mysql2006@mail.ru mysql2006@mail.ru
SELECT,INSERT,DELETE,UPDATE command denied to usual user for TEMPORARY table.

For self TEMPORARY table user must have any access.

Where promise that in new version this BUG (This is documented bug!) is overcome?

How to repeat:
After instalation vesion 6.0.9

By root:

CREATE USER 'my'@'localhost' IDENTIFIED BY '1';
revoke all privileges, grant option from 'my'@'localhost';
grant create temporary tables on * to 'my'@'localhost';

By 'my'@'localhost':

drop TEMPORARY table if exists tmp1;
CREATE TEMPORARY TABLE tmp1(keyorg char(15));
INSERT INTO tmp1(keyorg)values('WWW');
select * from tmp1;

mysql> select * from tmp1;
ERROR 1142 (42000): SELECT command denied to user 'my'@'localhost' for table 'tmp1'
mysql> INSERT INTO tmp1(keyorg)values('WWW');
ERROR 1142 (42000): INSERT command denied to user 'my'@'localhost' for table 'tmp1'

Suggested fix:
mysql> status
mysql.exe  Ver 14.15 Distrib 6.0.9-alpha, for Win32 (ia32)
Connection id:          11
Current database:       telephon
Current user:           my@localhost
SSL:                    Not in use
Using delimiter:        ;
Server version:         6.0.9-alpha-community MySQL Community Server (GPL)
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    cp1251
Db     characterset:    cp1251
Client characterset:    cp1251
Conn.  characterset:    cp1251
[2 Feb 2009 12:14] Valeriy Kravchuk
I think this is a duplicate of bug #2317 (and many other reports, like http://bugs.mysql.com/bug.php?id=21100, that are all feature reuqests). 

I do not see any evidence that this feature is implemented in 6.0.x (or is going to be implemented there).
[18 Sep 2009 16:09] MySQL Verification Team
Consolidating this and the related bugs as duplicates of bug #27480. Currently a fix for Bug #27480 is planned for release with 5.4 before it becomes GA.