File: rename_case.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (54 lines) | stat: -rw-r--r-- 1,385 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#
# This tests tries to cover renames with tables in different cases to ensure
# that lower case table names works
#

create database test2;
let $mysqld_datadir= `select @@datadir`;

--echo #
--echo # Testing rename error in different places
--echo #

create table t1 (a int);
create table T2 (b int);
create table t3 (c int);
create table T4 (d int);

insert into t1 values(1);
insert into T2 values(2);
insert into t3 values(3);
insert into T4 values(4);

create temporary table tmp1 (a int);
create temporary table tmp2 (b int);
create temporary table tmp3 (c int);
create temporary table tmp4 (d int);

insert into tmp1 values(11);
insert into tmp2 values(22);
insert into tmp3 values(33);
insert into tmp4 values(44);

--error ER_TABLE_EXISTS_ERROR
rename table t3 to T4, t1 to t5, T2 to t1, t5 to T2;
--error ER_TABLE_EXISTS_ERROR
rename table t1 to t5, t3 to T4, T2 to t1, t5 to T2;
--error ER_TABLE_EXISTS_ERROR
rename table t1 to t5, T2 to t1, t3 to T4, t5 to T2;
--error ER_TABLE_EXISTS_ERROR
rename table t1 to t5, T2 to t1, t5 to T2, t3 to T4;

--echo # Try failed rename using two databases
--error ER_NO_SUCH_TABLE
rename table test.t1 to test2.t5, test.T2 to test.t1, t5 to test.T2;

select t1.a+T2.b+t3.c+T4.d from t1,T2,t3,T4;
--error ER_NO_SUCH_TABLE
select * from t5;

--list_files $mysqld_datadir/test

--echo # Cleanup
drop table t1,T2,t3,T4;
drop database test2;