postgresql/src
Tom Lane 4d4c00850d Fix gist_box_same and gist_point_consistent to handle fuzziness correctly.
While there's considerable doubt that we want fuzzy behavior in the
geometric operators at all (let alone as currently implemented), nobody is
stepping forward to redesign that stuff.  In the meantime it behooves us
to make sure that index searches agree with the behavior of the underlying
operators.  This patch fixes two problems in this area.

First, gist_box_same was using fuzzy equality, but it really needs to use
exact equality to prevent not-quite-identical upper index keys from being
treated as identical, which for example would prevent an existing upper
key from being extended by an amount less than epsilon.  This would result
in inconsistent indexes.  (The next release notes will need to recommend
that users reindex GiST indexes on boxes, polygons, circles, and points,
since all four opclasses use gist_box_same.)

Second, gist_point_consistent used exact comparisons for upper-page
comparisons in ~= searches, when it needs to use fuzzy comparisons to
ensure it finds all matches; and it used fuzzy comparisons for point <@ box
searches, when it needs to use exact comparisons because that's what the
<@ operator (rather inconsistently) does.

The added regression test cases illustrate all three misbehaviors.

Back-patch to all active branches.  (8.4 did not have GiST point_ops,
but it still seems prudent to apply the gist_box_same patch to it.)

Alexander Korotkov, reviewed by Noah Misch
2013-02-08 18:03:28 -05:00
..
backend Fix gist_box_same and gist_point_consistent to handle fuzziness correctly. 2013-02-08 18:03:28 -05:00
bin Translation updates 2013-02-03 23:58:38 -05:00
include Repair bugs in GiST page splitting code for multi-column indexes. 2013-02-07 17:44:16 -05:00
interfaces Stamp 9.1.8. 2013-02-04 16:28:27 -05:00
makefiles Make pgxs build executables with the right suffix. 2013-01-19 14:54:29 -05:00
pl Translation updates 2013-02-03 23:58:38 -05:00
port Stamp 9.1.8. 2013-02-04 16:28:27 -05:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Fix gist_box_same and gist_point_consistent to handle fuzziness correctly. 2013-02-08 18:03:28 -05:00
timezone Add new timezone abbrevation "FET". 2013-01-14 14:46:21 -05:00
tools Properly zero-pad the day-of-year part of the win32 build number 2013-01-31 15:08:05 +01:00
tutorial Modernize string literal syntax in tutorial example. 2013-01-19 17:21:08 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Add mode where contrib installcheck runs each module in a separately named database. 2012-12-11 11:51:51 -05:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:50 -04:00
nls-global.mk Fix makefile logic to not break the build when xgettext is missing 2010-10-14 23:16:46 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00