Skip to content

Commit 632462f

Browse files
committed
Updated size_buffer function for sparse vectors (not an issue since int size_buffer is constant and libpqxx < 8 also adds terminating zero) [skip ci]
1 parent cdd9438 commit 632462f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/pgvector/pqxx.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ template<> struct string_traits<pgvector::SparseVector> {
252252
size += string_traits<int>::size_buffer(dimensions);
253253
for (size_t i = 0; i < nnz; i++) {
254254
size += 2; // : and ,
255-
size += string_traits<int>::size_buffer(indices[i]);
255+
size += string_traits<int>::size_buffer(indices[i] + 1);
256256
size += string_traits<float>::size_buffer(values[i]);
257257
}
258258
return size;

0 commit comments

Comments
 (0)