mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-28 23:02:43 +08:00
Added nnz check for vector/halfvec to sparsevec casts (in case limits change in future) [skip ci]
Co-authored-by: 0xJi3F
This commit is contained in:
@@ -614,6 +614,7 @@ vector_to_sparsevec(PG_FUNCTION_ARGS)
|
||||
nnz++;
|
||||
}
|
||||
|
||||
CheckNnz(nnz, dim);
|
||||
result = InitSparseVector(dim, nnz);
|
||||
values = SPARSEVEC_VALUES(result);
|
||||
for (int i = 0; i < dim; i++)
|
||||
@@ -657,6 +658,7 @@ halfvec_to_sparsevec(PG_FUNCTION_ARGS)
|
||||
nnz++;
|
||||
}
|
||||
|
||||
CheckNnz(nnz, dim);
|
||||
result = InitSparseVector(dim, nnz);
|
||||
values = SPARSEVEC_VALUES(result);
|
||||
for (int i = 0; i < dim; i++)
|
||||
|
||||
Reference in New Issue
Block a user