postgresql/src/test/regress
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
..
data Fix GIN to support null keys, empty and null items, and full index scans. 2011-01-07 19:16:24 -05:00
expected Fix gist_box_same and gist_point_consistent to handle fuzziness correctly. 2013-02-08 18:03:28 -05:00
input Fix error message for COMMENT/SECURITY LABEL ON COLUMN xxx IS 'yyy' 2012-05-22 11:24:16 -04:00
output Fix error message for COMMENT/SECURITY LABEL ON COLUMN xxx IS 'yyy' 2012-05-22 11:24:16 -04:00
sql Fix gist_box_same and gist_point_consistent to handle fuzziness correctly. 2013-02-08 18:03:28 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
GNUmakefile Rename pg_regress option --multibyte to --encoding 2011-04-15 08:42:05 +03:00
Makefile Remove remains of old depend target. 2007-01-20 17:16:17 +00:00
parallel_schedule Fix random discrepancies between parallel_schedule and serial_schedule. 2011-11-08 23:05:21 -05:00
pg_regress.c Prevent passing gmake's environment variables down through pg_regress. 2012-12-01 17:24:01 -05:00
pg_regress.h sepgsql, an SE-Linux integration for PostgreSQL 2011-01-23 20:48:27 -05:00
pg_regress_main.c sepgsql, an SE-Linux integration for PostgreSQL 2011-01-23 20:48:27 -05:00
regress.c Fix sloppy usage of TRIGGER_FIRED_BEFORE/TRIGGER_FIRED_AFTER. 2010-10-08 13:27:31 -04:00
regressplans.sh Tweak regressplans.sh to use any already-set PGOPTIONS. 2000-12-18 02:45:47 +00:00
resultmap Enable building with the Mingw64 compiler. 2011-01-30 19:56:46 -05:00
serial_schedule Fix random discrepancies between parallel_schedule and serial_schedule. 2011-11-08 23:05:21 -05:00
standby_schedule Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00