diff options
Diffstat (limited to 'src/backend/access/gist/gistscan.c')
-rw-r--r-- | src/backend/access/gist/gistscan.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/backend/access/gist/gistscan.c b/src/backend/access/gist/gistscan.c index aed3e95b4e..a53d8cd087 100644 --- a/src/backend/access/gist/gistscan.c +++ b/src/backend/access/gist/gistscan.c @@ -4,11 +4,11 @@ * routines to manage scans on GiST index relations * * - * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group + * Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.76 2009/06/11 14:48:53 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.79 2010/02/26 02:00:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -92,15 +92,18 @@ gistrescan(PG_FUNCTION_ARGS) * field. * * Next, if any of keys is a NULL and that key is not marked with - * SK_SEARCHNULL then nothing can be found. + * SK_SEARCHNULL/SK_SEARCHNOTNULL then nothing can be found (ie, we + * assume all indexable operators are strict). */ for (i = 0; i < scan->numberOfKeys; i++) { - scan->keyData[i].sk_func = so->giststate->consistentFn[scan->keyData[i].sk_attno - 1]; + ScanKey skey = &(scan->keyData[i]); - if (scan->keyData[i].sk_flags & SK_ISNULL) + skey->sk_func = so->giststate->consistentFn[skey->sk_attno - 1]; + + if (skey->sk_flags & SK_ISNULL) { - if ((scan->keyData[i].sk_flags & SK_SEARCHNULL) == 0) + if (!(skey->sk_flags & (SK_SEARCHNULL | SK_SEARCHNOTNULL))) so->qual_ok = false; } } |