Skip to content

Commit 8087cef

Browse files
committed
make rename test to work with InnoDB too
1 parent 445198c commit 8087cef

File tree

3 files changed

+62
-19
lines changed

3 files changed

+62
-19
lines changed

mysql-test/main/vector,myisam.rdiff

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,45 @@
3131
insert t1 (id, v) values (1, x'e360d63ebe554f3fcdbc523f4522193f5236083d');
3232
select id, hex(v) from t1;
3333
id hex(v)
34+
@@ -324,26 +346,32 @@
35+
# Test RENAME TABLE with vector index
36+
create table t1 (id int auto_increment primary key, v blob not null, vector index (v));
37+
db.opt
38+
-t1#i#01.ibd
39+
+t1#i#01.MYD
40+
+t1#i#01.MYI
41+
+t1.MYD
42+
+t1.MYI
43+
t1.frm
44+
-t1.ibd
45+
rename table t1 to t2;
46+
db.opt
47+
-t2#i#01.ibd
48+
+t2#i#01.MYD
49+
+t2#i#01.MYI
50+
+t2.MYD
51+
+t2.MYI
52+
t2.frm
53+
-t2.ibd
54+
create database test1;
55+
rename table test.t2 to test1.t1;
56+
db.opt
57+
-t1#i#01.ibd
58+
+t1#i#01.MYD
59+
+t1#i#01.MYI
60+
+t1.MYD
61+
+t1.MYI
62+
t1.frm
63+
-t1.ibd
64+
-call mtr.add_suppression('InnoDB: Cannot rename.*because the source file does not exist');
65+
-call mtr.add_suppression('InnoDB: File ./test1/t1#i#01.ibd was not found');
66+
rename table test1.t1 to test1.t2;
67+
Got one of the listed errors
68+
db.opt
69+
+t1#i#01.MYI
70+
+t1.MYD
71+
+t1.MYI
72+
t1.frm
73+
-t1.ibd
74+
drop database test1;
75+
db.opt

mysql-test/main/vector.result

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -322,34 +322,28 @@ t1 CREATE TABLE `t1` (
322322
drop table t1;
323323
db.opt
324324
# Test RENAME TABLE with vector index
325-
create table t1 (id int auto_increment primary key, v blob not null, vector index (v)) engine=MyISAM;
325+
create table t1 (id int auto_increment primary key, v blob not null, vector index (v));
326326
db.opt
327-
t1#i#01.MYD
328-
t1#i#01.MYI
329-
t1.MYD
330-
t1.MYI
327+
t1#i#01.ibd
331328
t1.frm
329+
t1.ibd
332330
rename table t1 to t2;
333331
db.opt
334-
t2#i#01.MYD
335-
t2#i#01.MYI
336-
t2.MYD
337-
t2.MYI
332+
t2#i#01.ibd
338333
t2.frm
334+
t2.ibd
339335
create database test1;
340336
rename table test.t2 to test1.t1;
341337
db.opt
342-
t1#i#01.MYD
343-
t1#i#01.MYI
344-
t1.MYD
345-
t1.MYI
338+
t1#i#01.ibd
346339
t1.frm
340+
t1.ibd
341+
call mtr.add_suppression('InnoDB: Cannot rename.*because the source file does not exist');
342+
call mtr.add_suppression('InnoDB: File ./test1/t1#i#01.ibd was not found');
347343
rename table test1.t1 to test1.t2;
348-
ERROR HY000: Error on rename of './test1/t1#i#01.MYD' to './test1/t2#i#01.MYD' (Errcode: 2 "No such file or directory")
344+
Got one of the listed errors
349345
db.opt
350-
t1#i#01.MYI
351-
t1.MYD
352-
t1.MYI
353346
t1.frm
347+
t1.ibd
354348
drop database test1;
355349
db.opt

mysql-test/main/vector.test

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,23 @@ drop table t1;
123123
list_files $datadir/test;
124124

125125
--echo # Test RENAME TABLE with vector index
126-
create table t1 (id int auto_increment primary key, v blob not null, vector index (v)) engine=MyISAM;
126+
create table t1 (id int auto_increment primary key, v blob not null, vector index (v));
127127
list_files $datadir/test;
128128
rename table t1 to t2;
129129
list_files $datadir/test;
130130
create database test1;
131131
rename table test.t2 to test1.t1;
132132
list_files $datadir/test1;
133133

134+
if ($MTR_COMBINATION_MYISAM) {
134135
remove_file $datadir/test1/t1#i#01.MYD;
135-
--error 7
136+
}
137+
if ($MTR_COMBINATION_INNODB) {
138+
call mtr.add_suppression('InnoDB: Cannot rename.*because the source file does not exist');
139+
call mtr.add_suppression('InnoDB: File ./test1/t1#i#01.ibd was not found');
140+
remove_file $datadir/test1/t1#i#01.ibd;
141+
}
142+
--error 7,ER_ERROR_ON_RENAME
136143
rename table test1.t1 to test1.t2;
137144
list_files $datadir/test1;
138145
drop database test1;

0 commit comments

Comments
 (0)