--source include/have_innodb.inc --echo # SHOW that CREATE TEMPORARY TABLE .. AS SELECT is --echo # at least partially atomic. --echo # That means it does not consist of two logically --echo # separated statements (1. CREATE 2. INSERT) --error ER_DUP_ENTRY CREATE TEMPORARY TABLE t1 (UNIQUE(f1)) ENGINE = InnoDB AS SELECT 1 AS f1 UNION ALL SELECT 1; --error ER_NO_SUCH_TABLE SELECT * FROM t1; --echo # SHOW that CREATE TEMPORARY TABLE .. AS SELECT is --echo # partially not atomic. SET AUTOCOMMIT = 0; CREATE TEMPORARY TABLE t1 (UNIQUE(f1)) ENGINE = InnoDB AS SELECT 1 AS f1; SELECT * FROM t1; ROLLBACK; --echo # If CREATE TEMPORARY TABLE .. AS SELECT would be --echo # full atomic I would see the error message --echo # "Table 'test.t1' doesn't exist" for the next statement. SELECT * FROM t1;