aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistget.c
diff options
context:
space:
mode:
authorTeodor Sigaev <teodor@sigaev.ru>2008-10-17 17:02:42 +0000
committerTeodor Sigaev <teodor@sigaev.ru>2008-10-17 17:02:42 +0000
commit2cae6fe7179c49197f22dec7292095764c4e9eaa (patch)
treec5b7c12497955a97d721ea2e0935941634bd9fd2 /src/backend/access/gist/gistget.c
parent6a6f47d00a7505e1b5d562321386253133e05367 (diff)
downloadpostgresql-2cae6fe7179c49197f22dec7292095764c4e9eaa.tar.gz
postgresql-2cae6fe7179c49197f22dec7292095764c4e9eaa.zip
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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c
index 9a9927ca05f..20bc99482dd 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.69.2.1 2008/08/23 10:40:03 teodor Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.69.2.2 2008/10/17 17:02:42 teodor Exp $
*
*-------------------------------------------------------------------------
*/
@@ -127,6 +127,9 @@ gistnext(IndexScanDesc scan, ScanDirection dir, ItemPointer tids,
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 */