Fix strategy propagation to scanEntry for partial match by moving propagation
authorTeodor Sigaev <teodor@sigaev.ru>
Thu, 4 Sep 2008 11:47:05 +0000 (11:47 +0000)
committerTeodor Sigaev <teodor@sigaev.ru>
Thu, 4 Sep 2008 11:47:05 +0000 (11:47 +0000)
to initializaion of scanEntry.

src/backend/access/gin/ginget.c
src/backend/access/gin/ginscan.c

index b9ae6e721092bd75edb02a05fca18a10fa797ebc..214454262f82b3c0fa8743d5605d1e5a4ee5d857 100644 (file)
@@ -395,14 +395,7 @@ startScanKey(Relation index, GinState *ginstate, GinScanKey key)
                return;
 
        for (i = 0; i < key->nentries; i++)
-       {
                startScanEntry(index, ginstate, key->scanEntry + i);
-               /*
-                * Copy strategy number to each entry of key to
-                * use in comparePartialFn call
-                */
-               key->scanEntry[i].strategy = key->strategy;
-       }
 
        memset(key->entryRes, TRUE, sizeof(bool) * key->nentries);
        key->isFinished = FALSE;
index e5636d72adf1164e281bfe0fa6db2c4825220957..1ebbc2ab788bdecca3effbd1845d9ddb861b8c53 100644 (file)
@@ -61,6 +61,7 @@ fillScanKey(GinState *ginstate, GinScanKey key, OffsetNumber attnum, Datum query
                key->scanEntry[i].offset = InvalidOffsetNumber;
                key->scanEntry[i].buffer = InvalidBuffer;
                key->scanEntry[i].partialMatch = NULL;
+               key->scanEntry[i].strategy = strategy;
                key->scanEntry[i].list = NULL;
                key->scanEntry[i].nlist = 0;
                key->scanEntry[i].isPartialMatch = ( ginstate->canPartialMatch[attnum - 1] && partial_matches )