aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2025-03-07 18:35:13 -0500
committerPeter Geoghegan <pg@bowt.ie>2025-03-07 18:35:13 -0500
commit8e167e618893b59ee45317c43055002ba71f955b (patch)
tree676387a3a935072f39834c4eab325d8f72154c39 /src
parent088f8e2d568eaa963fe68a15287002081314fad8 (diff)
downloadpostgresql-8e167e618893b59ee45317c43055002ba71f955b.tar.gz
postgresql-8e167e618893b59ee45317c43055002ba71f955b.zip
nbtree: refine _bt_readnextpage contract comments.
Another minor follow-up commit for commit 1bd4bc85, which changed the _bt_readnextpage contract.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/nbtree/nbtsearch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/nbtree/nbtsearch.c b/src/backend/access/nbtree/nbtsearch.c
index 472ce06f190..6b2f464aa04 100644
--- a/src/backend/access/nbtree/nbtsearch.c
+++ b/src/backend/access/nbtree/nbtsearch.c
@@ -2183,7 +2183,9 @@ _bt_readfirstpage(IndexScanDesc scan, OffsetNumber offnum, ScanDirection dir)
* scan. A seized=false caller's blkno can never be assumed to be the page
* that must be read next during a parallel scan, though. We must figure that
* part out for ourselves by seizing the scan (the correct page to read might
- * already be beyond the seized=false caller's blkno during a parallel scan).
+ * already be beyond the seized=false caller's blkno during a parallel scan,
+ * unless blkno/so->currPos.nextPage/so->currPos.prevPage is already P_NONE,
+ * or unless so->currPos.moreRight/so->currPos.moreLeft is already unset).
*
* On success exit, so->currPos is updated to contain data from the next
* interesting page, and we return true. We hold a pin on the buffer on
@@ -2204,6 +2206,7 @@ _bt_readnextpage(IndexScanDesc scan, BlockNumber blkno,
BTScanOpaque so = (BTScanOpaque) scan->opaque;
Assert(so->currPos.currPage == lastcurrblkno || seized);
+ Assert(!(blkno == P_NONE && seized));
Assert(!BTScanPosIsPinned(so->currPos));
/*