1DROP TABLE IF EXISTS t1,t2;
2CREATE TABLE t1(c1 INTEGER NULL);
3CREATE TABLE t2(c1 INTEGER NULL);
4SHOW TABLES;
5Tables_in_test
6t1
7t2
8SHOW CREATE TABLE t1;
9Table	Create Table
10t1	CREATE TABLE `t1` (
11  `c1` int(11) DEFAULT NULL
12) ENGINE=ENGINE DEFAULT CHARSET=latin1
13RENAME TABLE t2 TO t1;
14ERROR 42S01: Table 't1' already exists
15RENAME TABLE t3 TO t1;
16ERROR 42S01: Table 't1' already exists
17RENAME TABLE t3 TO doesnotexist.t1;
18ERROR 42S02: Table 'test.t3' doesn't exist
19SHOW TABLES;
20Tables_in_test
21t1
22t2
23SHOW CREATE TABLE t1;
24Table	Create Table
25t1	CREATE TABLE `t1` (
26  `c1` int(11) DEFAULT NULL
27) ENGINE=ENGINE DEFAULT CHARSET=latin1
28SHOW CREATE TABLE t2;
29Table	Create Table
30t2	CREATE TABLE `t2` (
31  `c1` int(11) DEFAULT NULL
32) ENGINE=ENGINE DEFAULT CHARSET=latin1
33DROP TABLE t2;
34SHOW TABLES;
35Tables_in_test
36t1
37DROP TABLE t1;
38