pgsql: Protect GIST logic that assumes penalty values can't be negative

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Protect GIST logic that assumes penalty values can't be negative
Date: 2011-05-31 21:54:38
Message-ID: E1QRWta-0000Qq-1y@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Protect GIST logic that assumes penalty values can't be negative.

Apparently sane-looking penalty code might return small negative values,
for example because of roundoff error. This will confuse places like
gistchoose(). Prevent problems by clamping negative penalty values to
zero. (Just to be really sure, I also made it force NaNs to zero.)
Back-patch to all supported branches.

Alexander Korotkov

Branch
------
REL8_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ca76a3956c80f97eb4ea0cc8fc2a54435f6a573b

Modified Files
--------------
doc/src/sgml/gist.sgml | 2 ++
src/backend/access/gist/gistutil.c | 14 +++++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Greg Stark 2011-05-31 23:07:12 Re: pgsql: Protect GIST logic that assumes penalty values can't be negative
Previous Message Tom Lane 2011-05-31 21:54:37 pgsql: Protect GIST logic that assumes penalty values can't be negative

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2011-05-31 21:55:49 Re: Fix for GiST penalty
Previous Message Marko Kreen 2011-05-31 21:52:34 Re: Please test peer (socket ident) auth on *BSD