Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5373817

Browse files
committed
Fix strategy propagation to scanEntry for partial match by moving propagation
to initializaion of scanEntry.
1 parent ba9f37f commit 5373817

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

src/backend/access/gin/ginget.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gin/ginget.c,v 1.18 2008/07/11 21:06:29 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gin/ginget.c,v 1.19 2008/09/04 11:47:05 teodor Exp $
1212
*-------------------------------------------------------------------------
1313
*/
1414

@@ -395,14 +395,7 @@ startScanKey(Relation index, GinState *ginstate, GinScanKey key)
395395
return;
396396

397397
for (i = 0; i < key->nentries; i++)
398-
{
399398
startScanEntry(index, ginstate, key->scanEntry + i);
400-
/*
401-
* Copy strategy number to each entry of key to
402-
* use in comparePartialFn call
403-
*/
404-
key->scanEntry[i].strategy = key->strategy;
405-
}
406399

407400
memset(key->entryRes, TRUE, sizeof(bool) * key->nentries);
408401
key->isFinished = FALSE;

src/backend/access/gin/ginscan.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.17 2008/07/11 21:06:29 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.18 2008/09/04 11:47:05 teodor Exp $
1212
*-------------------------------------------------------------------------
1313
*/
1414

@@ -61,6 +61,7 @@ fillScanKey(GinState *ginstate, GinScanKey key, OffsetNumber attnum, Datum query
6161
key->scanEntry[i].offset = InvalidOffsetNumber;
6262
key->scanEntry[i].buffer = InvalidBuffer;
6363
key->scanEntry[i].partialMatch = NULL;
64+
key->scanEntry[i].strategy = strategy;
6465
key->scanEntry[i].list = NULL;
6566
key->scanEntry[i].nlist = 0;
6667
key->scanEntry[i].isPartialMatch = ( ginstate->canPartialMatch[attnum - 1] && partial_matches )

0 commit comments

Comments
 (0)