Initialize GISTScanOpaque->qual_ok even if there is no conditions.
authorTeodor Sigaev <teodor@sigaev.ru>
Thu, 4 Dec 2008 11:10:06 +0000 (11:10 +0000)
committerTeodor Sigaev <teodor@sigaev.ru>
Thu, 4 Dec 2008 11:10:06 +0000 (11:10 +0000)
src/backend/access/gist/gistscan.c

index 377bf7749d6f2a0152a6a4b59bc53d909bcc5f86..c42c170a728b81b2b8126202a7d0d6d3f3f810a9 100644 (file)
@@ -76,6 +76,8 @@ gistrescan(PG_FUNCTION_ARGS)
        ItemPointerSetInvalid(&so->curpos);
        so->nPageData = so->curPageData = 0;
 
+       so->qual_ok = true;
+
        /* Update scan key, if a new one is given */
        if (key && scan->numberOfKeys > 0)
        {
@@ -92,7 +94,6 @@ gistrescan(PG_FUNCTION_ARGS)
                 * Next, if any of keys is a NULL and that key is not marked with
                 * SK_SEARCHNULL then nothing can be found.
                 */
-               so->qual_ok = true;
                for (i = 0; i < scan->numberOfKeys; i++) {
                        scan->keyData[i].sk_func = so->giststate->consistentFn[scan->keyData[i].sk_attno - 1];