aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/sequence.c
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/commands/sequence.c
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/commands/sequence.c')
-rw-r--r--src/backend/commands/sequence.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index c98f9811119..f38126f4f98 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -337,7 +337,7 @@ fill_seq_with_data(Relation rel, HeapTuple tuple)
buf = ReadBuffer(rel, P_NEW);
Assert(BufferGetBlockNumber(buf) == 0);
- page = BufferGetPage(buf);
+ page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
PageInit(page, BufferGetPageSize(buf), sizeof(sequence_magic));
sm = (sequence_magic *) PageGetSpecialPointer(page);
@@ -462,7 +462,7 @@ AlterSequence(AlterSeqStmt *stmt)
{
xl_seq_rec xlrec;
XLogRecPtr recptr;
- Page page = BufferGetPage(buf);
+ Page page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
XLogBeginInsert();
XLogRegisterBuffer(0, buf, REGBUF_WILL_INIT);
@@ -584,7 +584,7 @@ nextval_internal(Oid relid)
/* lock page' buffer and read tuple */
seq = read_seq_tuple(elm, seqrel, &buf, &seqtuple);
- page = BufferGetPage(buf);
+ page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
last = next = result = seq->last_value;
incby = seq->increment_by;
@@ -923,7 +923,7 @@ do_setval(Oid relid, int64 next, bool iscalled)
{
xl_seq_rec xlrec;
XLogRecPtr recptr;
- Page page = BufferGetPage(buf);
+ Page page = BufferGetPage(buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
XLogBeginInsert();
XLogRegisterBuffer(0, buf, REGBUF_WILL_INIT);
@@ -1115,7 +1115,7 @@ read_seq_tuple(SeqTable elm, Relation rel, Buffer *buf, HeapTuple seqtuple)
*buf = ReadBuffer(rel, 0);
LockBuffer(*buf, BUFFER_LOCK_EXCLUSIVE);
- page = BufferGetPage(*buf);
+ page = BufferGetPage(*buf, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
sm = (sequence_magic *) PageGetSpecialPointer(page);
if (sm->magic != SEQ_MAGIC)
@@ -1591,7 +1591,7 @@ seq_redo(XLogReaderState *record)
elog(PANIC, "seq_redo: unknown op code %u", info);
buffer = XLogInitBufferForRedo(record, 0);
- page = (Page) BufferGetPage(buffer);
+ page = BufferGetPage(buffer, NULL, NULL, BGP_NO_SNAPSHOT_TEST);
/*
* We always reinit the page. However, since this WAL record type is also