Bug #71110 | "create temporary table select * from table" does not produce consistent data | ||
---|---|---|---|
Submitted: | 8 Dec 2013 16:31 | Modified: | 9 Dec 2013 19:00 |
Reporter: | Toni Sanavullah | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Locking | Severity: | S2 (Serious) |
Version: | mysql-5.6.14 | OS: | Linux |
Assigned to: | CPU Architecture: | Any | |
Tags: | repeatable read |
[8 Dec 2013 16:31]
Toni Sanavullah
[9 Dec 2013 13:36]
Peter Laursen
I did not test on my environment(s) here but docs http://dev.mysql.com/doc/refman/5.6/en/implicit-commit.html say: "ALTER TABLE, CREATE TABLE, and DROP TABLE do not commit a transaction if the TEMPORARY keyword is used. (This does not apply to other operations on temporary tables such as CREATE INDEX, which do cause a commit.) However, although no implicit commit occurs, neither can the statement be rolled back. Therefore, use of such statements will violate transaction atomicity: For example, if you use CREATE TEMPORARY TABLE and then roll back the transaction, the table remains in existence." Peter (not a MySQL/Oracle person) -- and just listening!
[9 Dec 2013 19:00]
Sveta Smirnova
Thank you for the report. Although Peter is correct and you should not issue CREATE TABLE statement before closing transaction, our manual does not explicitly says if CREATE TEMPORARY TABLE ... SELECT should see results of committed transaction. It only says when CREATE TABLE commits and does not commit current transaction. Most likely this is user manual issue, but I verify it as server bug for now.