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:
Andrew Kane
2026-07-27 20:38:17 -07:00
parent 3566276bd4
commit c0919bc26a

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++)