From: Tom Lane Date: Fri, 27 Aug 2004 17:47:56 +0000 (+0000) Subject: Make gistindex_keytest safe against NULL values. Same fix was already X-Git-Tag: REL7_4_6~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=288e0404b83102236268d90f662f837d6e6ae0d3;p=thirdparty%2Fpostgresql.git Make gistindex_keytest safe against NULL values. Same fix was already made in passing for 8.0, but now that we have a bug report showing it's needed, we should put it into 7.4 branch. --- diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index bfa557bb9c6..596c11e41e8 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 - * $Header: /cvsroot/pgsql/src/backend/access/gist/gistget.c,v 1.36 2003/08/04 02:39:57 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/gist/gistget.c,v 1.36.4.1 2004/08/27 17:47:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -234,16 +234,16 @@ gistindex_keytest(IndexTuple tuple, key[0].sk_attno, giststate->tupdesc, &isNull); + /* is the index entry NULL? */ if (isNull) { /* XXX eventually should check if SK_ISNULL */ return false; } - -/* this code from backend/access/common/indexvalid.c. But why and what??? + /* is the compared-to datum NULL? */ if (key[0].sk_flags & SK_ISNULL) return false; -*/ + gistdentryinit(giststate, key[0].sk_attno - 1, &de, datum, r, p, offset, IndexTupleSize(tuple) - sizeof(IndexTupleData),