]> granicus.if.org Git - postgresql/commit
Protect GIST logic that assumes penalty values can't be negative.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 May 2011 21:54:06 +0000 (17:54 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 May 2011 21:54:06 +0000 (17:54 -0400)
commitca76a3956c80f97eb4ea0cc8fc2a54435f6a573b
tree7a8e7c233dde8f4ddd528801e442e7e5eec2999e
parent1d6dd87c4bfba8ceeb20f282ae4683e60163efb5
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
doc/src/sgml/gist.sgml
src/backend/access/gist/gistutil.c