pgvector.git / summary / log / commit / refs

commit    6731c498115ec64ebdc2bafb6be0ccf6bc241cb0
Author:   Andrew Kane <andrew@ankane.org>
Date:     Thu Jun 18 19:51:38 2026 +0000

    Fixed overflow check (should never be hit) [skip ci]


src/ivfkmeans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ivfkmeans.c b/src/ivfkmeans.c index 83e534f1..dc09552f 100644 --- a/src/ivfkmeans.c +++ b/src/ivfkmeans.c @@ -280,7 +280,7 @@ ElkanKmeans(Relation index, VectorArray samples, VectorArray centers, const Ivff IvfflatCheckMemoryUsage(totalSize); /* Ensure indexing does not overflow */ - if (numCenters * numCenters > INT_MAX) + if (numCenters > INT_MAX / numCenters) elog(ERROR, "Indexing overflow detected. Please report a bug."); /* Set support functions */ [parent: f2617f02d127]