Skip to content

Commit 5d9ebef

Browse files
committed
MDEV-35258 Mariabackup does not work with MyISAM tables with vector keys
recognize *#i#* files in mariadb-backup
1 parent 0b9bc6c commit 5d9ebef

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

extra/mariabackup/backup_copy.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,8 @@ void parse_db_table_from_file_path(
895895
*ptr = '\0';
896896
if ((ptr = strstr(tablename, "#P#")))
897897
*ptr = '\0';
898+
if ((ptr = strstr(tablename, "#i#")))
899+
*ptr = '\0';
898900
}
899901

900902
bool is_system_table(const char *dbname, const char *tablename)

mysql-test/suite/mariabackup/vector.result

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,30 @@ id
4949
5
5050
4
5151
drop table t1;
52+
#
53+
# MDEV-35258 Mariabackup does not work with MyISAM tables with vector keys
54+
#
55+
create table t1 (a int, v vector(1) not null, vector(v)) engine=MyISAM;
56+
insert into t1 values (1,0x31313131),(2,0x32323232);
57+
drop table t1;
58+
db.opt
59+
t1#i#00.MYD
60+
t1#i#00.MYI
61+
t1.MYD
62+
t1.MYI
63+
t1.frm
64+
# shutdown server
65+
# remove datadir
66+
# xtrabackup move back
67+
# restart
68+
show create table t1;
69+
Table Create Table
70+
t1 CREATE TABLE `t1` (
71+
`a` int(11) DEFAULT NULL,
72+
`v` vector(1) NOT NULL,
73+
VECTOR KEY `v` (`v`)
74+
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
75+
select * from t1 order by vec_distance_euclidean(v, 0x30303030) limit 1;
76+
a v
77+
1 1111
78+
drop table t1;

mysql-test/suite/mariabackup/vector.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,23 @@ select id, Vec_ToText(v) from t1;
2828
select id from t1 order by vec_distance_euclidean(v, Vec_FromText('[1,0,0,0,0]')) limit 3;
2929
drop table t1;
3030
rmdir $targetdir;
31+
32+
--echo #
33+
--echo # MDEV-35258 Mariabackup does not work with MyISAM tables with vector keys
34+
--echo #
35+
36+
create table t1 (a int, v vector(1) not null, vector(v)) engine=MyISAM;
37+
insert into t1 values (1,0x31313131),(2,0x32323232);
38+
--disable_result_log
39+
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
40+
exec $XTRABACKUP --prepare --target-dir=$targetdir;
41+
--enable_result_log
42+
43+
drop table t1;
44+
--list_files $targetdir/test
45+
--source include/restart_and_restore.inc
46+
47+
show create table t1;
48+
select * from t1 order by vec_distance_euclidean(v, 0x30303030) limit 1;
49+
drop table t1;
50+
rmdir $targetdir;

0 commit comments

Comments
 (0)