diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2008-10-17 17:02:21 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2008-10-17 17:02:21 +0000 |
commit | beeb3562dd5194bf47f8f06565f4b54b181eb64b (patch) | |
tree | 472a814c4cc946da5f0761ab1cb7530131520641 /src/backend/access/gist/gistget.c | |
parent | e034e517a70265a2e7f9552d2a9fd33102d21896 (diff) | |
download | postgresql-beeb3562dd5194bf47f8f06565f4b54b181eb64b.tar.gz |
During repeated rescan of GiST index it's possible that scan key
is NULL but SK_SEARCHNULL is not set. Add checking IS NULL of keys
to set during key initialization. If key is NULL and SK_SEARCHNULL is not
set then nothnig can be satisfied.
With assert-enabled compilation that causes coredump.
Bug was introduced in 8.3 by support of IS NULL index scan.
Diffstat (limited to 'src/backend/access/gist/gistget.c')
-rw-r--r-- | src/backend/access/gist/gistget.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index 97ae1cfd58..574eeff7ff 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.75 2008/08/23 10:37:24 teodor Exp $ + * $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.76 2008/10/17 17:02:21 teodor Exp $ * *------------------------------------------------------------------------- */ @@ -134,6 +134,9 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm) so = (GISTScanOpaque) scan->opaque; + if ( so->qual_ok == false ) + return 0; + if (ItemPointerIsValid(&so->curpos) == false) { /* Being asked to fetch the first entry, so start at the root */ |