summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistget.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/gist/gistget.c')
-rw-r--r--src/backend/access/gist/gistget.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c
index e7ca8f6476..216910307a 100644
--- a/src/backend/access/gist/gistget.c
+++ b/src/backend/access/gist/gistget.c
@@ -4,11 +4,11 @@
* fetch tuples from a GiST scan.
*
*
- * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.81 2009/06/11 14:48:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.85 2010/02/26 02:00:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -388,8 +388,6 @@ gistindex_keytest(IndexTuple tuple,
giststate = so->giststate;
p = BufferGetPage(so->curbuf);
- IncrIndexProcessed();
-
scan->xs_recheck = false;
/*
@@ -415,14 +413,21 @@ gistindex_keytest(IndexTuple tuple,
{
/*
* On non-leaf page we can't conclude that child hasn't NULL
- * values because of assumption in GiST: uinon (VAL, NULL) is VAL
- * But if on non-leaf page key IS NULL then all childs has NULL.
+ * values because of assumption in GiST: union (VAL, NULL) is VAL.
+ * But if on non-leaf page key IS NULL, then all children are
+ * NULL.
*/
-
- Assert(key->sk_flags & SK_SEARCHNULL);
-
- if (GistPageIsLeaf(p) && !isNull)
- return false;
+ if (key->sk_flags & SK_SEARCHNULL)
+ {
+ if (GistPageIsLeaf(p) && !isNull)
+ return false;
+ }
+ else
+ {
+ Assert(key->sk_flags & SK_SEARCHNOTNULL);
+ if (isNull)
+ return false;
+ }
}
else if (isNull)
{