Switched to 0-based numbering for sparsevec on-disk format

This commit is contained in:
Andrew Kane
2024-04-24 12:51:24 -07:00
parent 4d21eea6f1
commit 78e5bcf229
4 changed files with 20 additions and 15 deletions

View File

@@ -1318,7 +1318,7 @@ sparsevec_to_vector(PG_FUNCTION_ARGS)
result = InitVector(dim);
for (int i = 0; i < svec->nnz; i++)
result->x[svec->indices[i] - 1] = values[i];
result->x[svec->indices[i]] = values[i];
PG_RETURN_POINTER(result);
}