Temporary tables can not be dropped inside stored procedure

Bug #1372301 reported by Philip Stoev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Status tracked in 5.6
5.6
New
Undecided
Unassigned

Bug Description

One of the innodb MTR tests contains the following frequent programming idiom:

DELIMITER |

CREATE FUNCTION f1() RETURNS INT
BEGIN
CREATE TEMPORARY TABLE t1(c1 iNT AUTO_INCREMENT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(NULL);
DROP TEMPORARY TABLE t1;
 RETURN 42;
END |

DELIMITER ;

SELECT f1();

DROP FUNCTION f1;
DROP TEMPORARY TABLE IF EXISTS t1;

In stock InnoDB, this work because the temporary tables are handled separately (there is no implicit commit-on-ddl). In Galera, this results in "Deadlock found when trying to get lock; try restarting transaction" even though no concurrent transactions are running.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.