Debian Codegraph @

mysql-test/suite/atomic/rename_case.test

raw
1 #
2 # This tests tries to cover renames with tables in different cases to ensure
3 # that lower case table names works
4 #
5
6 create database test2;
7 let $mysqld_datadir= `select @@datadir`;
8
9 --echo #
10 --echo # Testing rename error in different places
11 --echo #
12
13 create table t1 (a int);
14 create table T2 (b int);
15 create table t3 (c int);
16 create table T4 (d int);
17
18 insert into t1 values(1);
19 insert into T2 values(2);
20 insert into t3 values(3);
21 insert into T4 values(4);
22
23 create temporary table tmp1 (a int);
24 create temporary table tmp2 (b int);
25 create temporary table tmp3 (c int);
26 create temporary table tmp4 (d int);
27
28 insert into tmp1 values(11);
29 insert into tmp2 values(22);
30 insert into tmp3 values(33);
31 insert into tmp4 values(44);
32
33 --error ER_TABLE_EXISTS_ERROR
34 rename table t3 to T4, t1 to t5, T2 to t1, t5 to T2;
35 --error ER_TABLE_EXISTS_ERROR
36 rename table t1 to t5, t3 to T4, T2 to t1, t5 to T2;
37 --error ER_TABLE_EXISTS_ERROR
38 rename table t1 to t5, T2 to t1, t3 to T4, t5 to T2;
39 --error ER_TABLE_EXISTS_ERROR
40 rename table t1 to t5, T2 to t1, t5 to T2, t3 to T4;
41
42 --echo # Try failed rename using two databases
43 --error ER_NO_SUCH_TABLE
44 rename table test.t1 to test2.t5, test.T2 to test.t1, t5 to test.T2;
45
46 select t1.a+T2.b+t3.c+T4.d from t1,T2,t3,T4;
47 --error ER_NO_SUCH_TABLE
48 select * from t5;
49
50 --list_files $mysqld_datadir/test
51
52 --echo # Cleanup
53 drop table t1,T2,t3,T4;
54 drop database test2;