1
drop table if exists t1, t2;
2
CREATE TABLE t1 ( a int );
3
INSERT INTO t1 VALUES (1),(2),(1);
4
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
5
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
7
ERROR 42S02: Table 'test.t2' doesn't exist
8
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=INNODB SELECT a FROM t1;
9
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
11
ERROR 42S02: Table 'test.t2' doesn't exist
12
CREATE TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
13
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
15
ERROR 42S02: Table 'test.t2' doesn't exist
16
CREATE TEMPORARY TABLE t2 ( PRIMARY KEY (a) ) ENGINE=MYISAM SELECT a FROM t1;
17
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
19
ERROR 42S02: Table 'test.t2' doesn't exist