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:
Andrew Kane
2026-07-28 09:08:01 -07:00
committed by zeekay
parent 0a99770a2c
commit 9c34ba4583
+2
View File
@@ -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++)