aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistget.c
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2006-05-24 11:01:39 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2006-05-24 11:01:39 +0000
commitd2158b02813bb44116988eeb10d9a32565b58c1c (patch)
tree64a114b2a90a7620c302013f5d35cddbac9b35c3 /src/backend/access/gist/gistget.c
parent86722057fdbec6b2419359b553bdbb6fd0558798 (diff)
downloadpostgresql-d2158b02813bb44116988eeb10d9a32565b58c1c.tar.gz
postgresql-d2158b02813bb44116988eeb10d9a32565b58c1c.zip
* Add support NULL to GiST.
* some refactoring and simplify code int gistutil.c and gist.c * now in some cases it can be called used-defined picksplit method for non-first column in index, but here is a place to do more. * small fix of docs related to support NULL.
Diffstat (limited to 'src/backend/access/gist/gistget.c')
-rw-r--r--src/backend/access/gist/gistget.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c
index 55d45b4a038..dcb8f2da54b 100644
--- a/src/backend/access/gist/gistget.c
+++ b/src/backend/access/gist/gistget.c
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.56 2006/03/05 15:58:20 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.57 2006/05/24 11:01:39 teodor Exp $
*
*-------------------------------------------------------------------------
*/
@@ -361,7 +361,7 @@ gistindex_keytest(IndexTuple tuple,
IncrIndexProcessed();
/*
- * Tuple doesn't restore after crash recovery because of inclomplete
+ * Tuple doesn't restore after crash recovery because of incomplete
* insert
*/
if (!GistPageIsLeaf(p) && GistTupleIsInvalid(tuple))
@@ -378,14 +378,15 @@ gistindex_keytest(IndexTuple tuple,
key->sk_attno,
giststate->tupdesc,
&isNull);
- /* is the index entry NULL? */
- if (isNull)
- {
- /* XXX eventually should check if SK_ISNULL */
+
+ if ( key->sk_flags & SK_ISNULL ) {
+ /* is the compared-to datum NULL? on non-leaf page it's possible
+ to have nulls in childs :( */
+
+ if ( isNull || !GistPageIsLeaf(p) )
+ return true;
return false;
- }
- /* is the compared-to datum NULL? */
- if (key->sk_flags & SK_ISNULL)
+ } else if ( isNull )
return false;
gistdentryinit(giststate, key->sk_attno - 1, &de,