aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorKevin Grittner <kgrittn@postgresql.org>2016-04-08 14:30:10 -0500
committerKevin Grittner <kgrittn@postgresql.org>2016-04-08 14:30:10 -0500
commit8b65cf4c5edabdcae45ceaef7b9ac236879aae50 (patch)
treef4412d3e9bc0db823ac32e08fac8e3124b42ff02 /src/backend/executor
parent689f9a058854a1a32e994818dd6d79f49d8f8a1b (diff)
downloadpostgresql-8b65cf4c5edabdcae45ceaef7b9ac236879aae50.tar.gz
postgresql-8b65cf4c5edabdcae45ceaef7b9ac236879aae50.zip
Modify BufferGetPage() to prepare for "snapshot too old" feature
This patch is a no-op patch which is intended to reduce the chances of failures of omission once the functional part of the "snapshot too old" patch goes in. It adds parameters for snapshot, relation, and an enum to specify whether the snapshot age check needs to be done for the page at this point. This initial patch passes NULL for the first two new parameters and BGP_NO_SNAPSHOT_TEST for the third. The follow-on patch will change the places where the test needs to be made.
Diffstat (limited to 'src/backend/executor')
-rw-r--r--src/backend/executor/nodeBitmapHeapscan.c4
-rw-r--r--src/backend/executor/nodeSamplescan.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/executor/nodeBitmapHeapscan.c b/src/backend/executor/nodeBitmapHeapscan.c
index 449aacb6e74..b7a2ca7fc61 100644
--- a/src/backend/executor/nodeBitmapHeapscan.c
+++ b/src/backend/executor/nodeBitmapHeapscan.c
@@ -257,7 +257,7 @@ BitmapHeapNext(BitmapHeapScanState *node)
* Okay to fetch the tuple
*/
targoffset = scan->rs_vistuples[scan->rs_cindex];
- dp = (Page) BufferGetPage(scan->rs_cbuf);
+ dp = BufferGetPage(scan->rs_cbuf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
lp = PageGetItemId(dp, targoffset);
Assert(ItemIdIsNormal(lp));
@@ -375,7 +375,7 @@ bitgetpage(HeapScanDesc scan, TBMIterateResult *tbmres)
* Bitmap is lossy, so we must examine each item pointer on the page.
* But we can ignore HOT chains, since we'll check each tuple anyway.
*/
- Page dp = (Page) BufferGetPage(buffer);
+ Page dp = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
OffsetNumber maxoff = PageGetMaxOffsetNumber(dp);
OffsetNumber offnum;
diff --git a/src/backend/executor/nodeSamplescan.c b/src/backend/executor/nodeSamplescan.c
index 9ce7c02aff4..e12b424bcec 100644
--- a/src/backend/executor/nodeSamplescan.c
+++ b/src/backend/executor/nodeSamplescan.c
@@ -435,7 +435,7 @@ tablesample_getnext(SampleScanState *scanstate)
if (!pagemode)
LockBuffer(scan->rs_cbuf, BUFFER_LOCK_SHARE);
- page = (Page) BufferGetPage(scan->rs_cbuf);
+ page = BufferGetPage(scan->rs_cbuf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
all_visible = PageIsAllVisible(page) && !snapshot->takenDuringRecovery;
maxoffset = PageGetMaxOffsetNumber(page);
@@ -546,7 +546,7 @@ tablesample_getnext(SampleScanState *scanstate)
if (!pagemode)
LockBuffer(scan->rs_cbuf, BUFFER_LOCK_SHARE);
- page = (Page) BufferGetPage(scan->rs_cbuf);
+ page = BufferGetPage(scan->rs_cbuf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
all_visible = PageIsAllVisible(page) && !snapshot->takenDuringRecovery;
maxoffset = PageGetMaxOffsetNumber(page);
}