mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
mysqldump and mariadb-backup tests of vector indexes
This commit is contained in:
30
mysql-test/suite/mariabackup/vector.test
Normal file
30
mysql-test/suite/mariabackup/vector.test
Normal file
@@ -0,0 +1,30 @@
|
||||
create table t1 (id int auto_increment primary key, v blob not null, vector index (v)) engine=innodb;
|
||||
insert t1 (v) values (Vec_Fromtext('[0.418,0.809,0.823,0.598,0.033]')),
|
||||
(Vec_Fromtext('[0.687,0.789,0.496,0.574,0.917]')),
|
||||
(Vec_Fromtext('[0.333,0.962,0.467,0.448,0.475]')),
|
||||
(Vec_Fromtext('[0.822,0.185,0.683,0.211,0.554]')),
|
||||
(Vec_Fromtext('[0.437,0.167,0.077,0.428,0.241]')),
|
||||
(Vec_Fromtext('[0.769,0.926,0.803,0.015,0.589]')),
|
||||
(Vec_Fromtext('[0.493,0.641,0.761,0.942,0.425]')),
|
||||
(Vec_Fromtext('[0.924,0.275,0.054,0.073,0.136]')),
|
||||
(Vec_Fromtext('[0.186,0.696,0.035,0.668,0.847]')),
|
||||
(Vec_Fromtext('[0.415,0.609,0.426,0.988,0.475]'));
|
||||
select id from t1 order by vec_distance_euclidean(v, Vec_FromText('[1,0,0,0,0]')) limit 3;
|
||||
|
||||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
|
||||
let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log;
|
||||
|
||||
--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 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;
|
Reference in New Issue
Block a user