~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

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