| 1 |
create database test2; |
| 2 |
# |
| 3 |
# Testing rename error in different places |
| 4 |
# |
| 5 |
create table t1 (a int); |
| 6 |
create table T2 (b int); |
| 7 |
create table t3 (c int); |
| 8 |
create table T4 (d int); |
| 9 |
insert into t1 values(1); |
| 10 |
insert into T2 values(2); |
| 11 |
insert into t3 values(3); |
| 12 |
insert into T4 values(4); |
| 13 |
create temporary table tmp1 (a int); |
| 14 |
create temporary table tmp2 (b int); |
| 15 |
create temporary table tmp3 (c int); |
| 16 |
create temporary table tmp4 (d int); |
| 17 |
insert into tmp1 values(11); |
| 18 |
insert into tmp2 values(22); |
| 19 |
insert into tmp3 values(33); |
| 20 |
insert into tmp4 values(44); |
| 21 |
rename table t3 to T4, t1 to t5, T2 to t1, t5 to T2; |
| 22 |
ERROR 42S01: Table 'T4' already exists |
| 23 |
rename table t1 to t5, t3 to T4, T2 to t1, t5 to T2; |
| 24 |
ERROR 42S01: Table 'T4' already exists |
| 25 |
rename table t1 to t5, T2 to t1, t3 to T4, t5 to T2; |
| 26 |
ERROR 42S01: Table 'T4' already exists |
| 27 |
rename table t1 to t5, T2 to t1, t5 to T2, t3 to T4; |
| 28 |
ERROR 42S01: Table 'T4' already exists |
| 29 |
# Try failed rename using two databases |
| 30 |
rename table test.t1 to test2.t5, test.T2 to test.t1, t5 to test.T2; |
| 31 |
ERROR 42S02: Table 'test.t5' doesn't exist |
| 32 |
select t1.a+T2.b+t3.c+T4.d from t1,T2,t3,T4; |
| 33 |
t1.a+T2.b+t3.c+T4.d |
| 34 |
10 |
| 35 |
select * from t5; |
| 36 |
ERROR 42S02: Table 'test.t5' doesn't exist |
| 37 |
T2.MYD |
| 38 |
T2.MYI |
| 39 |
T2.frm |
| 40 |
T4.MYD |
| 41 |
T4.MYI |
| 42 |
T4.frm |
| 43 |
db.opt |
| 44 |
t1.MYD |
| 45 |
t1.MYI |
| 46 |
t1.frm |
| 47 |
t3.MYD |
| 48 |
t3.MYI |
| 49 |
t3.frm |
| 50 |
# Cleanup |
| 51 |
drop table t1,T2,t3,T4; |
| 52 |
drop database test2; |