pgsql: Fix integer overflow bug in GiST buffering build calculations. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Fix integer overflow bug in GiST buffering build calculations.
Date
Msg-id E1SZS6E-0000rE-Ki@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix integer overflow bug in GiST buffering build calculations.

The result of (maintenance_work_mem * 1024) / BLCKSZ doesn't fit in a signed
32-bit integer, if maintenance_work_mem >= 2GB. Use double instead. And
while we're at it, write the calculations in an easier to understand form,
with the intermediary steps written out and commented.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/4bc6fb57f774ea18187fd8565aad9994160bfc17

Modified Files
--------------
src/backend/access/gist/gistbuild.c |   32 +++++++++++++++++++++++---------
1 files changed, 23 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Teach AbortOutOfAnyTransaction to clean up partially-started tra
Next
From: Bruce Momjian
Date:
Subject: Re: pgsql: Eliminate some more O(N^2) behaviors in pg_dump/pg_restore.