Hello!
I am working on a stress-test framework and was trying to use it to
reproduce this bug.
It reproduced, but SP-GiST failed after the fix was applied.
AI tool decided the issue was caused by a problem in the patch; the
AI-crafted fix is attached.
I haven't validated it carefully, sorry, but I think it will be helpful.
Best regards,
Mikhail.
diff --git a/src/backend/access/spgist/spgscan.c b/src/backend/access/spgist/spgscan.c
index 455d587dfda..97685f8e3a9 100644
--- a/src/backend/access/spgist/spgscan.c
+++ b/src/backend/access/spgist/spgscan.c
@@ -591,7 +591,7 @@ spgLeafTest(SpGistScanOpaque so, SpGistSearchItem *item,
{
Assert(item != NULL);
vischeck = table_index_vischeck_tuple(tableRel, &so->vmbuf,
- &item->heapPtr);
+ &leafTuple->heapPtr);
}
/* item passes the scankeys */