Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mysql-test/main/information_schema-big.result
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ TRIGGERS TRIGGER_SCHEMA
USERS USER
USER_PRIVILEGES GRANTEE
USER_STATISTICS USER
VECTOR_INDEXES TABLE_SCHEMA
VIEWS TABLE_SCHEMA
SELECT t.table_name, c1.column_name
FROM information_schema.tables t
Expand Down Expand Up @@ -136,4 +137,5 @@ TRIGGERS TRIGGER_SCHEMA
USERS USER
USER_PRIVILEGES GRANTEE
USER_STATISTICS USER
VECTOR_INDEXES TABLE_SCHEMA
VIEWS TABLE_SCHEMA
2 changes: 2 additions & 0 deletions mysql-test/main/information_schema-big_embedded.result
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ TRIGGERS TRIGGER_SCHEMA
USERS USER
USER_PRIVILEGES GRANTEE
USER_STATISTICS USER
VECTOR_INDEXES TABLE_SCHEMA
VIEWS TABLE_SCHEMA
SELECT t.table_name, c1.column_name
FROM information_schema.tables t
Expand Down Expand Up @@ -134,4 +135,5 @@ TRIGGERS TRIGGER_SCHEMA
USERS USER
USER_PRIVILEGES GRANTEE
USER_STATISTICS USER
VECTOR_INDEXES TABLE_SCHEMA
VIEWS TABLE_SCHEMA
2 changes: 2 additions & 0 deletions mysql-test/main/information_schema.result
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ TRIGGERS
USERS
USER_PRIVILEGES
USER_STATISTICS
VECTOR_INDEXES
VIEWS
column_stats
columns_priv
Expand Down Expand Up @@ -1035,6 +1036,7 @@ TABLES TABLE_NAME select
TABLE_CONSTRAINTS TABLE_NAME select
TABLE_PRIVILEGES TABLE_NAME select
TABLE_STATISTICS TABLE_NAME select
VECTOR_INDEXES TABLE_NAME select
VIEWS TABLE_NAME select
connection default;
disconnect user10261;
Expand Down
8 changes: 7 additions & 1 deletion mysql-test/main/information_schema_all_engines.result
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ TRIGGERS
USERS
USER_PRIVILEGES
USER_STATISTICS
VECTOR_INDEXES
VIEWS
SELECT t.table_name, c1.column_name
FROM information_schema.tables t
Expand Down Expand Up @@ -163,6 +164,7 @@ TRIGGERS TRIGGER_SCHEMA
USERS USER
USER_PRIVILEGES GRANTEE
USER_STATISTICS USER
VECTOR_INDEXES TABLE_SCHEMA
VIEWS TABLE_SCHEMA
SELECT t.table_name, c1.column_name
FROM information_schema.tables t
Expand Down Expand Up @@ -252,6 +254,7 @@ TRIGGERS TRIGGER_SCHEMA
USERS USER
USER_PRIVILEGES GRANTEE
USER_STATISTICS USER
VECTOR_INDEXES TABLE_SCHEMA
VIEWS TABLE_SCHEMA
select 1 as "must be 1" from information_schema.tables where "ACCOUNTS"=
(select cast(table_name as char) from information_schema.tables
Expand Down Expand Up @@ -339,6 +342,7 @@ TRIGGERS information_schema.TRIGGERS 1
USERS information_schema.USERS 1
USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
USER_STATISTICS information_schema.USER_STATISTICS 1
VECTOR_INDEXES information_schema.VECTOR_INDEXES 1
VIEWS information_schema.VIEWS 1
+---------------------------------------+
+---------------------------------------+
Expand Down Expand Up @@ -418,6 +422,7 @@ Database: information_schema
| USERS |
| USER_PRIVILEGES |
| USER_STATISTICS |
| VECTOR_INDEXES |
| VIEWS |
+---------------------------------------+
+---------------------------------------+
Expand Down Expand Up @@ -497,6 +502,7 @@ Database: INFORMATION_SCHEMA
| USERS |
| USER_PRIVILEGES |
| USER_STATISTICS |
| VECTOR_INDEXES |
| VIEWS |
+--------------------+
+--------------------+
Expand All @@ -506,5 +512,5 @@ Wildcard: inf_rmation_schema
| information_schema |
SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') GROUP BY TABLE_SCHEMA;
table_schema count(*)
information_schema 74
information_schema 75
mysql 31
91 changes: 64 additions & 27 deletions mysql-test/main/vector,aria.rdiff
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
create table t1 (id int auto_increment primary key,
u vector(5) not null, vector index (u),
v vector(5) not null, vector index (v));
@@ -12,7 +12,7 @@ t1 CREATE TABLE `t1` (
@@ -12,7 +12,7 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -16,7 +16,7 @@
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t1 0 PRIMARY 1 id A 0 NULL NULL BTREE NO
@@ -27,7 +27,7 @@ t1 CREATE TABLE `t1` (
@@ -27,7 +27,7 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`) `m`='7'
Expand All @@ -25,7 +25,7 @@
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t1 0 PRIMARY 1 id A 0 NULL NULL BTREE NO
@@ -42,7 +42,7 @@ t1 CREATE TABLE `t1` (
@@ -42,7 +42,7 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`) `m`='5'
Expand All @@ -34,7 +34,7 @@
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t1 0 PRIMARY 1 id A 0 NULL NULL BTREE NO
@@ -343,7 +343,7 @@ t2 CREATE TABLE `t2` (
@@ -346,7 +346,7 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -43,7 +43,7 @@
drop table t1, t2;
db.opt
# Test insert ... select with vector index
@@ -388,8 +388,32 @@ db.opt
@@ -391,8 +391,32 @@
create table t1 (id int auto_increment primary key, v vector(5) not null, vector index (v));
insert t1 (id, v) values (1, x'e360d63ebe554f3fcdbc523f4522193f5236083d');
truncate table t1;
Expand Down Expand Up @@ -76,7 +76,7 @@
insert t1 (id, v) values (1, x'e360d63ebe554f3fcdbc523f4522193f5236083d');
select id, hex(v) from t1;
id hex(v)
@@ -401,33 +425,39 @@ t1 CREATE TABLE `t1` (
@@ -404,33 +428,39 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand Down Expand Up @@ -126,7 +126,7 @@
drop database test1;
db.opt
#
@@ -442,7 +472,7 @@ t1 CREATE TABLE `t1` (
@@ -445,7 +475,7 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`) `distance`='cosine'
Expand All @@ -135,7 +135,7 @@
insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'),
(x'f511303f72224a3fdd05fe3eb22a133ffae86a3f'),
(x'f09baa3ea172763f123def3e0c7fe53e288bf33e'),
@@ -504,9 +534,11 @@ insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'),
@@ -507,9 +537,11 @@
# ADD/DROP COLUMN, ALGORITHM=COPY
alter table t1 add column a int, algorithm=copy;
db.opt
Expand All @@ -149,7 +149,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -515,12 +547,14 @@ t1 CREATE TABLE `t1` (
@@ -518,12 +550,14 @@
`a` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -167,7 +167,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -528,13 +562,15 @@ t1 CREATE TABLE `t1` (
@@ -531,13 +565,15 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -186,7 +186,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -543,12 +579,14 @@ t1 CREATE TABLE `t1` (
@@ -546,12 +582,14 @@
PRIMARY KEY (`id`),
KEY `a` (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -204,7 +204,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -556,13 +594,15 @@ t1 CREATE TABLE `t1` (
@@ -559,13 +597,15 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -223,7 +223,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -571,12 +611,14 @@ t1 CREATE TABLE `t1` (
@@ -574,12 +614,14 @@
PRIMARY KEY (`id`),
KEY `a` (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -241,7 +241,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -584,13 +626,15 @@ t1 CREATE TABLE `t1` (
@@ -587,13 +629,15 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -260,7 +260,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -599,12 +643,14 @@ t1 CREATE TABLE `t1` (
@@ -602,12 +646,14 @@
`a` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -278,7 +278,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -612,24 +658,27 @@ t1 CREATE TABLE `t1` (
@@ -615,24 +661,27 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand Down Expand Up @@ -311,7 +311,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -637,24 +686,27 @@ t1 CREATE TABLE `t1` (
@@ -640,24 +689,27 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand Down Expand Up @@ -344,7 +344,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -662,7 +714,7 @@ t1 CREATE TABLE `t1` (
@@ -665,7 +717,7 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -353,7 +353,7 @@
# ADD/DROP INDEX, ALGORITHM=INPLACE (non-vector)
alter table t1 add index a(id), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
@@ -685,31 +737,15 @@ ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITH
@@ -688,31 +740,15 @@
alter table t1 modify column v vector(7) not null, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
# ADD/CHANGE/DROP/MODIFY COLUMN, ALGORITHM=INPLACE (non-vector)
Expand Down Expand Up @@ -389,7 +389,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -717,13 +753,15 @@ t1 CREATE TABLE `t1` (
@@ -720,13 +756,15 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -408,7 +408,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -731,14 +769,16 @@ t1 CREATE TABLE `t1` (
@@ -734,14 +772,16 @@
`w` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`w`)
Expand All @@ -428,7 +428,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -746,7 +786,7 @@ t1 CREATE TABLE `t1` (
@@ -749,7 +789,7 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `w` (`v`)
Expand All @@ -437,7 +437,7 @@
alter table t1 rename key w to v;
# IF [NOT] EXISTS
create vector index if not exists v on t1(v);
@@ -757,77 +797,22 @@ drop index if exists v on t1;
@@ -760,77 +800,22 @@
Warnings:
Note 1091 Can't DROP INDEX `v`; check that it exists
db.opt
Expand Down Expand Up @@ -518,7 +518,7 @@
# CHANGE/MODIFY/DROP COLUMN (vector)
alter table t1 modify column v int;
ERROR HY000: Incorrect arguments to VECTOR INDEX
@@ -839,9 +824,11 @@ alter table t1 change column v v vector(6);
@@ -842,9 +827,11 @@
ERROR 42000: All parts of a VECTOR index must be NOT NULL
alter table t1 modify column v vector(7) not null;
db.opt
Expand All @@ -532,7 +532,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -849,12 +836,14 @@ t1 CREATE TABLE `t1` (
@@ -852,12 +839,14 @@
`v` vector(7) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -550,7 +550,7 @@
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -862,17 +851,18 @@ t1 CREATE TABLE `t1` (
@@ -865,17 +854,18 @@
`v` vector(5) NOT NULL,
PRIMARY KEY (`id`),
VECTOR KEY `v` (`v`)
Expand All @@ -572,10 +572,47 @@
drop table t1;
create table t1(v vector(5) not null, vector index(v));
alter table t1 add column a int;
@@ -889,5 +879,5 @@ Table Create Table
@@ -892,7 +882,7 @@
t CREATE TABLE `t` (
`v` vector(1) NOT NULL,
VECTOR KEY `v` (`v`) `distance`='cosine'
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci
+) ENGINE=Aria DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci PAGE_CHECKSUM=1
drop table t;
#
# MDEV-35821 - vector index sizes are not in INDEX_LENGTH
@@ -929,8 +919,8 @@
TABLE_NAME t_vec
INDEX_NAME vi
VECTOR_DIMENSIONS 4
-INDEX_SIZE 49152
-TOTAL_NODES 1
+INDEX_SIZE 16384
+TOTAL_NODES 0
CACHED_NODES 0
DELETED_ROWS 0
SUBDIST_ENABLED NO
@@ -949,11 +939,11 @@
SUBDIST_ENABLED
FROM INFORMATION_SCHEMA.VECTOR_INDEXES
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 't_vec';
-INDEX_SIZE 49152
+INDEX_SIZE 40960
TOTAL_NODES 3
-CACHED_NODES 0
+CACHED_NODES 3
DELETED_ROWS 0
-has_mem 0
+has_mem 1
SUBDIST_ENABLED NO
# After search
SELECT id FROM t_vec ORDER BY vec_distance_euclidean(v, VEC_FromText('[1,2,3,4]')) LIMIT 1;
@@ -990,7 +980,7 @@
DELETED_ROWS
FROM INFORMATION_SCHEMA.VECTOR_INDEXES
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 't_vec';
-INDEX_SIZE 49152
+INDEX_SIZE 40960
TOTAL_NODES 3
CACHED_NODES 3
has_mem 1
Loading