Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2011-05-31 21:53:45 +0000
committerTom Lane2011-05-31 21:53:45 +0000
commit6923d699bc3c46ca2c5d8c12fe1c5c39ecfee11d (patch)
tree52992a247d48ba2dc48068787d184820d5e61a51 /doc/src/sgml/gist.sgml
parentba4cacf0756f71e175d25bac78834715a353e64e (diff)
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
Diffstat (limited to 'doc/src/sgml/gist.sgml')
-rw-r--r--doc/src/sgml/gist.sgml2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/src/sgml/gist.sgml b/doc/src/sgml/gist.sgml
index f6e31092aa1..78171cfa3fd 100644
--- a/doc/src/sgml/gist.sgml
+++ b/doc/src/sgml/gist.sgml
@@ -378,6 +378,8 @@ my_decompress(PG_FUNCTION_ARGS)
Returns a value indicating the <quote>cost</quote> of inserting the new
entry into a particular branch of the tree. Items will be inserted
down the path of least <function>penalty</function> in the tree.
+ Values returned by <function>penalty</function> should be non-negative.
+ If a negative value is returned, it will be treated as zero.
</para>
<para>