Bug #41917 No warning is printed when 'CREATE TEMPORARY TABLE' is rolled back

Submitted: 7 Jan 2009 10:56 Modified: 7 Jan 2009 11:50
Reporter: Sven Sandberg Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Errors Severity:S2 (Serious)
Version:5.1+ OS:Any
Assigned to: CPU Architecture:Any
Tags: CREATE TEMPORARY TABLE, rollback, warning

[7 Jan 2009 10:56] Sven Sandberg
Description:
When normal non-transactional statements are part of a transaction, and get rolled back, there is a warning:

Warning	1196	Some non-transactional changed tables couldn't be rolled back

However, no warning is given when a CREATE TEMPORARY TABLE is part of a transaction and get rolled back.

Note: no warning is given when a CREATE TABLE (without TEMPORARY) is inside a BEGIN...ROLLBACK block either, but that's normal because CREATE TABLE does an implicit commit before and after, so it is in fact not rolled back. However, CREATE TEMPORARY TABLE does not do any implicit commit, so it is within the scope of the ROLLBACK. That justifies that there should be a warning.

How to repeat:
BEGIN;
  CREATE TEMPORARY TABLE t1 (a INT);   # Does not give any warning
ROLLBACK;
SELECT * FROM t1;

BEGIN;
  INSERT INTO t1 VALUES (1);           # Gives a warning
ROLLBACK;
SELECT * FROM t1;

Suggested fix:
Generate a warning when CREATE TEMPORARY TABLE is rolled back.
[7 Jan 2009 11:50] MySQL Verification Team
Thank you for the bug report. Verified as described.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.