diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-06-24 00:18:52 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-06-24 00:18:52 +0000 |
commit | 9a09248eddf12339677169064c88e4df11e5077f (patch) | |
tree | ff29984a029e973b85b2869de2c115399c7c6b07 /src/backend/access/common/indexvalid.c | |
parent | dea41174b205ee592d46c074518b38d97b8b90c2 (diff) | |
download | postgresql-9a09248eddf12339677169064c88e4df11e5077f.tar.gz postgresql-9a09248eddf12339677169064c88e4df11e5077f.zip |
Fix rtree and contrib/rtree_gist search behavior for the 1-D box and
polygon operators (<<, &<, >>, &>). Per ideas originally put forward
by andrew@supernews and later rediscovered by moi. This patch just
fixes the existing opclasses, and does not add any new behavior as I
proposed earlier; that can be sorted out later. In principle this
could be back-patched, since it changes only search behavior and not
system catalog entries nor rtree index contents. I'm not currently
planning to do that, though, since I think it could use more testing.
Diffstat (limited to 'src/backend/access/common/indexvalid.c')
-rw-r--r-- | src/backend/access/common/indexvalid.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/backend/access/common/indexvalid.c b/src/backend/access/common/indexvalid.c index 2dcea775274..29ee54c3bfe 100644 --- a/src/backend/access/common/indexvalid.c +++ b/src/backend/access/common/indexvalid.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/common/indexvalid.c,v 1.33 2004/12/31 21:59:07 pgsql Exp $ + * $PostgreSQL: pgsql/src/backend/access/common/indexvalid.c,v 1.34 2005/06/24 00:18:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -59,8 +59,16 @@ index_keytest(IndexTuple tuple, test = FunctionCall2(&key->sk_func, datum, key->sk_argument); - if (!DatumGetBool(test)) - return false; + if (key->sk_flags & SK_NEGATE) + { + if (DatumGetBool(test)) + return false; + } + else + { + if (!DatumGetBool(test)) + return false; + } key++; scanKeySize--; |