mirror of
https://github.com/pgvector/pgvector.git
synced 2026-12-04 00:08:30 +00:00
Hardened build dimensions check [skip ci]
This commit is contained in:
1 parent
568fea3ab6
commit
3a6c970e86
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -696,7 +696,7 @@ InitBuildState(HnswBuildState * buildstate, Relation heap, Relation index, Index
|
||||
errmsg("type not supported for hnsw index")));
|
||||
|
||||
/* Require column to have dimensions to be indexed */
|
||||
if (buildstate->dimensions < 0)
|
||||
if (buildstate->dimensions < 1)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("column does not have dimensions")));
|
||||
|
||||
+1
-1
@@ -343,7 +343,7 @@ InitBuildState(IvfflatBuildState * buildstate, Relation heap, Relation index, In
|
||||
errmsg("type not supported for ivfflat index")));
|
||||
|
||||
/* Require column to have dimensions to be indexed */
|
||||
if (buildstate->dimensions < 0)
|
||||
if (buildstate->dimensions < 1)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
|
||||
errmsg("column does not have dimensions")));
|
||||
|
||||
Reference in new issue
Block a user