v1-0001-Fix-shimTriConsistentFn-mutating-the-entryRes-val.patch
application/octet-stream
Filename: v1-0001-Fix-shimTriConsistentFn-mutating-the-entryRes-val.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v1-0001
Subject: Fix shimTriConsistentFn mutating the entryRes values for MAYBE entries
| File | + | − |
|---|---|---|
| src/backend/access/gin/ginlogic.c | 8 | 1 |
From 5684bf43cdc15cc54a906d28fb06bd926d481898 Mon Sep 17 00:00:00 2001
From: Vinod Sridharan <vsridh90@gmail.com>
Date: Fri, 11 Apr 2025 16:28:36 -0700
Subject: [PATCH v1] Fix shimTriConsistentFn mutating the entryRes values for
MAYBE entries
---
src/backend/access/gin/ginlogic.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/backend/access/gin/ginlogic.c b/src/backend/access/gin/ginlogic.c
index 665ff9b9810..b3d66acba97 100644
--- a/src/backend/access/gin/ginlogic.c
+++ b/src/backend/access/gin/ginlogic.c
@@ -200,13 +200,20 @@ shimTriConsistentFn(GinScanKey key)
recheck |= key->recheckCurItem;
if (curResult != boolResult)
- return GIN_MAYBE;
+ {
+ curResult = GIN_MAYBE;
+ break;
+ }
}
/* TRUE with recheck is taken to mean MAYBE */
if (curResult == GIN_TRUE && recheck)
curResult = GIN_MAYBE;
+ /* Restore the maybe entry state */
+ for (i = 0; i < nmaybe; i++)
+ key->entryRes[maybeEntries[i]] = GIN_MAYBE;
+
return curResult;
}
--
2.25.1