]> git.ipfire.org Git - thirdparty/postgresql.git/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:11 +0000 (17:54 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 May 2011 21:54:11 +0000 (17:54 -0400)
commit08779dc699634858d4940158f5de12e1c7ff1448
tree704ca0821b3e9be6956228a7fd4cd08dc73fadde
parentfccef77183aff3c96b92c533a8858122cc46cb3c
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