mirror of
https://github.com/hanzoai/sql-vector.git
synced 2026-10-01 00:37:19 +00:00
Added nnz check for vector/halfvec to sparsevec casts (in case limits change in future) [skip ci]
Co-authored-by: 0xJi3F (cherry picked from commit c0919bc26ae7449dc7448b959449394372affbae)
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