~vlad-lesin/percona-server/mysql-5.0.33-original

« back to all changes in this revision

Viewing changes to mysql-test/t/create_select_tmp.test

  • Committer: Vlad Lesin
  • Date: 2012-07-31 09:21:34 UTC
  • Revision ID: vladislav.lesin@percona.com-20120731092134-zfodx022b7992wsi
VirginĀ 5.0.33

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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.
 
7
 
 
8
-- source include/have_innodb.inc
 
9
--disable_warnings
 
10
drop table if exists t1, t2;
 
11
--enable_warnings
 
12
CREATE TABLE t1 ( a int );
 
13
INSERT INTO t1 VALUES (1),(2),(1);
 
14
--error 1062
 
15
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
 
16
--error 1146
 
17
select * from t2;
 
18
--error 1062
 
19
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
 
20
--error 1146
 
21
select * from t2;
 
22
--error 1062
 
23
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
 
24
--error 1146
 
25
select * from t2;
 
26
--error 1062
 
27
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
 
28
--error 1146
 
29
select * from t2;
 
30
drop table t1;
 
31
 
 
32
# End of 4.1 tests