]> 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:01 +0000 (17:54 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 May 2011 21:54:01 +0000 (17:54 -0400)
commit8057b7554bde98d887f02f5c0c7aeca01c8b52c9
tree17181ab434a846067ecca843e33cdf23374cea14
parent0699d053ba8eede356e59e6e220716891cbee7fe
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