Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDEV-33408 Introduce session variables to manage HNSW index parameters #3226

Open
wants to merge 28 commits into
base: bb-11.4-vec-vicentiu-hugo
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
7b87e01
MDEV-32885 VEC_DISTANCE() function
vuvova Nov 25, 2023
ed8b6da
make INFORMATION_SCHEMA.STATISTICS.COMMENT not nullable
vuvova Jan 19, 2024
4bea056
fix main.plugin_vars test to cleanup after itself
vuvova Feb 5, 2024
62e6031
cleanup: spaces, casts, comments
vuvova Jan 8, 2024
e409868
cleanup: pass TABLE_SHARE to store_key_options()
vuvova Jan 26, 2024
bc8a7a3
reject invalid spatial key declarations in the parser
vuvova Jan 8, 2024
16846b5
cleanup: remove unconditional #ifdef's
vuvova Jan 10, 2024
2cd2320
cleanup: lex_string_set3()
vuvova Jan 27, 2024
8ddb99a
cleanup: Queue and Bounded_queue
vuvova Feb 6, 2024
ef14f42
cleanup: key algorithm vs key flags
vuvova Jan 14, 2024
022bc34
cleanup: make_long_hash_field_name() and add_hash_field()
vuvova Jan 18, 2024
38e84a8
cleanup: generalize ER_SPATIAL_CANT_HAVE_NULL
vuvova Jan 17, 2024
f1d0352
cleanup: generalize ER_INNODB_NO_FT_TEMP_TABLE
vuvova Jan 25, 2024
0cbd050
cleanup: extract ha_create_table_from_share()
vuvova Jan 25, 2024
cdcf739
open frm for DROP TABLE
vuvova Jan 26, 2024
3fa8be1
cleanup: unused function argument
vuvova Jan 26, 2024
cc82b35
Revert "MDEV-15458 Segfault in heap_scan() upon UPDATE after ADD SYST…
vuvova Feb 9, 2024
a857b68
initial support for vector indexes
vuvova Jan 17, 2024
9ca6554
Initial fixup
cvicentiu Feb 17, 2024
1568677
Wip
cvicentiu Feb 21, 2024
e944876
Graph insert possibly working ok
cvicentiu Feb 22, 2024
b34a896
Search is now working, but layer unaware
cvicentiu Feb 22, 2024
8aa7c1e
wip
cvicentiu Feb 22, 2024
3d0e4ea
Vec insert and search working on a multi-layer
cvicentiu Feb 23, 2024
437e214
MDEV-33408 Alter HNSW graph storage and fix memory leak
HugoWenTD Apr 12, 2024
ee2cc47
Support files for ann-workspace
cvicentiu Apr 15, 2024
7829259
Bug fixes - on top of Hugo's patch
cvicentiu Apr 18, 2024
5899540
Introduce session variables to manage HNSW index parameters
HugoWenTD Apr 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
cleanup: generalize ER_SPATIAL_CANT_HAVE_NULL
  • Loading branch information
vuvova authored and cvicentiu committed Apr 4, 2024
commit 38e84a8315c8dde291a9b669d13fa6b8def02303
1 change: 1 addition & 0 deletions include/mysql.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ typedef unsigned long long my_ulonglong;
#define ER_UNSUPPORTED_ENGINE_FOR_VIRTUAL_COLUMNS ER_UNSUPPORTED_ENGINE_FOR_GENERATED_COLUMNS
#define ER_KEY_COLUMN_DOES_NOT_EXITS ER_KEY_COLUMN_DOES_NOT_EXIST
#define ER_DROP_PARTITION_NON_EXISTENT ER_PARTITION_DOES_NOT_EXIST
#define ER_SPATIAL_CANT_HAVE_NULL ER_INDEX_CANNOT_HAVE_NULL

typedef struct st_mysql_rows {
struct st_mysql_rows *next; /* list of rows */
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/suite/gcol/t/innodb_virtual_basic.test
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ CREATE TABLE t (a TEXT, b TEXT GENERATED ALWAYS AS (a));
ALTER TABLE t ADD FULLTEXT INDEX (b);
DROP TABLE t;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
CREATE TABLE t (a geometry not null, b geometry GENERATED ALWAYS AS (a), spatial INDEX idx (b));
CREATE TABLE t (a geometry not null, b geometry GENERATED ALWAYS AS (a));
--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE t ADD SPATIAL INDEX (b);
DROP TABLE t;

Expand Down Expand Up @@ -526,7 +526,7 @@ SHOW CREATE TABLE t1;
DROP TABLE t1;

# No spatial and FTS index on virtual columns
--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
CREATE TABLE t (a INT, b INT GENERATED ALWAYS AS (a), c point, d point GENERATED ALWAYS AS (c), spatial index idx (d));

--error ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN
Expand Down
22 changes: 11 additions & 11 deletions mysql-test/suite/innodb_gis/t/alter_spatial_index.test
Original file line number Diff line number Diff line change
Expand Up @@ -134,31 +134,31 @@ SELECT c1,ST_AsText(c2),ST_AsText(c4) FROM tab WHERE MBRWithin(tab.c4, @g1);

DELETE FROM tab WHERE MBRWithin(tab.c4, @g1);

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE tab MODIFY COLUMN c2 MULTIPOINT;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE tab MODIFY COLUMN c3 MULTILINESTRING;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE tab MODIFY COLUMN c4 MULTIPOLYGON;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE tab MODIFY COLUMN c3 MULTILINESTRING NULL;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE tab MODIFY COLUMN c4 MULTIPOLYGON NULL;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE tab MODIFY COLUMN c4 Geometry NULL;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE tab CHANGE COLUMN c2 c22 POINT;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE tab CHANGE COLUMN c3 c33 LINESTRING;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE tab CHANGE COLUMN c4 c44 POLYGON;

# --error ER_SPATIAL_MUST_HAVE_GEOM_COL
Expand Down Expand Up @@ -716,7 +716,7 @@ create table t1 (c1 int) engine=innodb;
insert into t1 values(NULL);

# Add spatial index fail, since geometry column can't be null.
--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
alter table t1 add b geometry, add spatial index(b), algorithm=inplace;

# Add spatial index fail, since there's invalid geo data.
Expand All @@ -736,7 +736,7 @@ create table t1 (c1 int) engine=innodb;
insert into t1 values(NULL);

# Add spatial index fail, since geometry column can't be null.
--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
alter table t1 add b geometry, add spatial index(b), algorithm=copy;

# Add spatial index fail, since there's a NULL or invalid geo data.
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/suite/innodb_gis/t/point_basic.test
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ DELETE FROM t1 WHERE p1 = ST_PointFromText('POINT(10 19)');
SELECT ST_AsText(p1) FROM t1;

--echo # Add spatial keys on the table
--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE t1 ADD SPATIAL(p), ADD SPATIAL(p1);
SELECT c.name, c.mtype, c.prtype, c.len
FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS c
Expand Down Expand Up @@ -176,7 +176,7 @@ UPDATE t1 SET p1 = ST_PointFromText('POINT(5 5)');

SELECT ST_AsText(pp), ST_AsText(p1) FROM t1;

--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
ALTER TABLE t1 ADD SPATIAL(p1), ADD SPATIAL(pp), ALGORITHM = COPY;
SELECT c.name, c.mtype, c.prtype, c.len
FROM INFORMATION_SCHEMA.INNODB_SYS_COLUMNS c
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/vcol/inc/vcol_keys.inc
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ drop table t1;
if (!$skip_spatial_index_check)
{
--echo # Error "All parts of a SPATIAL index must be NOT NULL"
--error ER_SPATIAL_CANT_HAVE_NULL
--error ER_INDEX_CANNOT_HAVE_NULL
create table t1 (a int, b geometry as (a+1) persistent, spatial index (b));
create table t1 (a int, b int as (a+1) persistent);
--error ER_WRONG_ARGUMENTS
Expand Down
21 changes: 10 additions & 11 deletions sql/share/errmsg-utf8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5642,17 +5642,16 @@ ER_NOT_SUPPORTED_AUTH_MODE 08004
spa "El cliente no soporta protocolo de autenticación requerido por el servidor; considere mejorar el cliente MariaDB"
sw "Mteja haungi mkono itifaki ya uthibitishaji iliyoombwa na seva; fikiria kuboresha mteja wa MariaDB"
swe "Klienten stöder inte autentiseringsprotokollet som begärts av servern; överväg uppgradering av klientprogrammet"
ER_SPATIAL_CANT_HAVE_NULL 42000
chi "SPATIAL索引的所有部分必须不为null"
eng "All parts of a SPATIAL index must be NOT NULL"
ger "Alle Teile eines SPATIAL-Index müssen als NOT NULL deklariert sein"
geo "SPATIAL ინდექსის ყველა ნაწილი NOT NULL უნდა იყოს"
jpn "空間索引のキー列は NOT NULL でなければいけません。"
nla "Alle delete van een SPATIAL index dienen als NOT NULL gedeclareerd te worden"
por "Todas as partes de uma SPATIAL index devem ser NOT NULL"
spa "Todas las partes de un índice SPATIAL deben de ser NOT NULL"
sw "Sehemu zote za faharisi ya SPATIAL lazima ziwe NOT NULL"
swe "Alla delar av en SPATIAL index måste vara NOT NULL"
ER_INDEX_CANNOT_HAVE_NULL 42000
chi "%s索引的所有部分必须不为null"
eng "All parts of a %s index must be NOT NULL"
ger "Alle Teile eines %s-Index müssen als NOT NULL deklariert sein"
geo "%s ინდექსის ყველა ნაწილი NOT NULL უნდა იყოს"
nla "Alle delete van een %s index dienen als NOT NULL gedeclareerd te worden"
por "Todas as partes de uma %s index devem ser NOT NULL"
spa "Todas las partes de un índice %s deben de ser NOT NULL"
sw "Sehemu zote za faharisi ya %s lazima ziwe NOT NULL"
swe "Alla delar av en %s index måste vara NOT NULL"
ER_COLLATION_CHARSET_MISMATCH 42000
chi "COLLATION'%s'无效地用于字符集'%s'"
eng "COLLATION '%s' is not valid for CHARACTER SET '%s'"
Expand Down
3 changes: 1 addition & 2 deletions sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3298,8 +3298,7 @@ mysql_prepare_create_table_finalize(THD *thd, HA_CREATE_INFO *create_info,
DBUG_RETURN(TRUE);
if (!(sql_field->flags & NOT_NULL_FLAG))
{
my_message(ER_SPATIAL_CANT_HAVE_NULL,
ER_THD(thd, ER_SPATIAL_CANT_HAVE_NULL), MYF(0));
my_error(ER_INDEX_CANNOT_HAVE_NULL, MYF(0), "SPATIAL");
DBUG_RETURN(TRUE);
}
break;
Expand Down