MDEV-35258 Mariabackup does not work with MyISAM tables with vector keys

recognize *#i#* files in mariadb-backup
This commit is contained in:
Sergei Golubchik 2024-10-26 13:38:45 +02:00
parent 0b9bc6c3cd
commit 5d9ebef41e
3 changed files with 49 additions and 0 deletions

View file

@ -895,6 +895,8 @@ void parse_db_table_from_file_path(
*ptr = '\0';
if ((ptr = strstr(tablename, "#P#")))
*ptr = '\0';
if ((ptr = strstr(tablename, "#i#")))
*ptr = '\0';
}
bool is_system_table(const char *dbname, const char *tablename)

View file

@ -49,3 +49,30 @@ id
5
4
drop table t1;
#
# MDEV-35258 Mariabackup does not work with MyISAM tables with vector keys
#
create table t1 (a int, v vector(1) not null, vector(v)) engine=MyISAM;
insert into t1 values (1,0x31313131),(2,0x32323232);
drop table t1;
db.opt
t1#i#00.MYD
t1#i#00.MYI
t1.MYD
t1.MYI
t1.frm
# shutdown server
# remove datadir
# xtrabackup move back
# restart
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`v` vector(1) NOT NULL,
VECTOR KEY `v` (`v`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
select * from t1 order by vec_distance_euclidean(v, 0x30303030) limit 1;
a v
1 1111
drop table t1;

View file

@ -28,3 +28,23 @@ select id, Vec_ToText(v) from t1;
select id from t1 order by vec_distance_euclidean(v, Vec_FromText('[1,0,0,0,0]')) limit 3;
drop table t1;
rmdir $targetdir;
--echo #
--echo # MDEV-35258 Mariabackup does not work with MyISAM tables with vector keys
--echo #
create table t1 (a int, v vector(1) not null, vector(v)) engine=MyISAM;
insert into t1 values (1,0x31313131),(2,0x32323232);
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
exec $XTRABACKUP --prepare --target-dir=$targetdir;
--enable_result_log
drop table t1;
--list_files $targetdir/test
--source include/restart_and_restore.inc
show create table t1;
select * from t1 order by vec_distance_euclidean(v, 0x30303030) limit 1;
drop table t1;
rmdir $targetdir;