postgres.git / summary / log / commit / refs
commit 3fe8f2c35e8aa3786e779cf077ff5415e1fcee9f
Author: David Rowley <drowley@postgresql.org>
Date: Tue Nov 10 22:39:36 2026 +0000
First released in: 19.0
Avoid integer wraparound when adding new HASH partition
Specifying an overly large modulus could result in an integer wraparound
while checking for overlapping partitions when adding a new HASH
partition. Upgrade to 64-bit integers to avoid this.
Bug: #19836
Reported-by: Sumedh Pathak <sumedhpathak@gmail.com>
Author: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/19836-0754d466a59c7d00@postgresql.org
Backpatch-through: 15
src/backend/partitioning/partbounds.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c
index a0a1363d5be..b53b255bef3 100644
--- a/src/backend/partitioning/partbounds.c
+++ b/src/backend/partitioning/partbounds.c
@@ -2931,8 +2931,8 @@ check_new_partition_bound(char *relname, Relation parent,
if (partdesc->nparts > 0)
{
- int greatest_modulus;
- int remainder;
+ int64 greatest_modulus;
+ int64 remainder;
int offset;
/*
[parent: f1b267e78413]