Michal Hlavac <hlavki@medium13.sk> writes:
> Tom Lane wrote:
>> I can't reproduce a crash here, but perhaps that's because you have not
>> supplied any sample data...
> I attached file with data, where it fails...
Thanks. It turns out the main reason I couldn't reproduce it was
I was testing in CVS tip, where the bug had already been repaired.
I've applied the attached patch to the 7.4 branch to fix it there.
regards, tom lane
Index: gistget.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/access/gist/gistget.c,v
retrieving revision 1.36
diff -c -r1.36 gistget.c
*** gistget.c 4 Aug 2003 02:39:57 -0000 1.36
--- gistget.c 27 Aug 2004 17:44:04 -0000
***************
*** 234,249 ****
key[0].sk_attno,
giststate->tupdesc,
&isNull);
if (isNull)
{
/* XXX eventually should check if SK_ISNULL */
return false;
}
!
! /* this code from backend/access/common/indexvalid.c. But why and what???
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),
--- 234,249 ----
key[0].sk_attno,
giststate->tupdesc,
&isNull);
+ /* is the index entry NULL? */
if (isNull)
{
/* XXX eventually should check if SK_ISNULL */
return false;
}
! /* 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),