1
# Testcase for BUG#4551
2
# The bug was that when the table was TEMPORARY, it was not deleted if
3
# the CREATE SELECT failed (the code intended too, but it actually
4
# didn't). And as the CREATE TEMPORARY TABLE was not written to the
5
# binlog if it was a transactional table, it resulted in an
6
# inconsistency between binlog and the internal list of temp tables.
8
drop table if exists t1, t2;
9
drop table if exists t1;
11
a int DEFAULT 0 NOT NULL
13
INSERT INTO t1 VALUES (1),(2),(1);
15
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
16
--error ER_NO_SUCH_TABLE
19
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
20
--error ER_NO_SUCH_TABLE
23
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
24
--error ER_NO_SUCH_TABLE
27
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
28
--error ER_NO_SUCH_TABLE