File: vector2_notembedded.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, 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 (66 lines) | stat: -rw-r--r-- 2,427 bytes parent folder | download
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
55
56
57
58
59
60
61
62
63
64
65
66
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_sequence.inc

--echo #
--echo # mysqldump
--echo #
create table t1 (id int auto_increment primary key, v vector(5) not null);
insert t1 (v) values (Vec_Fromtext('[0.418,0.809,0.823,0.598,0.033]')),
                     (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;
exec $MYSQL_DUMP --compact test t1;
replace_regex /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/YYYY-MM-DD hh:mm:ss/;
exec $MYSQL_DUMP --compact --xml test t1;
exec $MYSQL_DUMP test t1 > $MYSQL_TMP_DIR/vector.sql;
exec $MYSQL test < $MYSQL_TMP_DIR/vector.sql;
remove_file $MYSQL_TMP_DIR/vector.sql;
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;

--echo #
--echo # MDEV-35044 ALTER on a table with vector index attempts to bypass unsupported locking limitation, server crashes in THD::free_tmp_table_share
--echo #
create table t (a int primary key, v vector(10) not null, vector index(v));
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter table t modify a int auto_increment, lock=none;
drop table t;

--echo #
--echo # MDEV-35061 XA PREPARE "not supported by the engine" from storage engine mhnsw, memory leak
--echo #
create table t1 (v vector(1) not null, vector(v)) engine=innodb;
insert into t1 select 0x00000000 as v from seq_1_to_1000;

--connect con1,localhost,root
--send alter table t1 add column x int, algorithm=copy;
--connection default
xa start 'x';
--error ER_NO_SUCH_TABLE
select * from non_existing_table;
delete from t1;
xa end 'x';
--error ER_GET_ERRNO
xa prepare 'x';
--connection con1
--reap
--disconnect con1
--connection default
drop table t1;

--echo #
--echo # MDEV-35223 REPAIR does not fix MyISAM table with vector key after crash recovery
--echo #
call mtr.add_suppression('t#i#00'' is marked as crashed and should be repaired');
create table t (v vector(1) not null, vector(v)) engine=myisam;
insert into t (v) values (0x30303030),(0x31313131);
--let $shutdown_timeout=0
--source include/restart_mysqld.inc
check table t extended;
repair table t extended;
check table t extended;
select v from t order by vec_distance_euclidean(0x32323232,v) limit 1;
drop table t;