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