agora inbox for [email protected]
help / color / mirror / Atom feedFrom: Alvaro Herrera <[email protected]>
Subject: [PATCH] heap_prepare_freeze_tuple: Simplify coding
Date: Thu, 2 May 2019 11:50:18 -0400
---
src/backend/access/heap/heapam.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index a05b6a07ad0..d6ceb8fd4a4 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -6108,9 +6108,9 @@ heap_prepare_freeze_tuple(HeapTupleHeader tuple,
/* Process xmin */
xid = HeapTupleHeaderGetXmin(tuple);
- xmin_frozen = ((xid == FrozenTransactionId) ||
- HeapTupleHeaderXminFrozen(tuple));
- if (TransactionIdIsNormal(xid))
+ if (!TransactionIdIsNormal(xid))
+ xmin_frozen = true;
+ else
{
if (TransactionIdPrecedes(xid, relfrozenxid))
ereport(ERROR,
@@ -6118,7 +6118,8 @@ heap_prepare_freeze_tuple(HeapTupleHeader tuple,
errmsg_internal("found xmin %u from before relfrozenxid %u",
xid, relfrozenxid)));
- if (TransactionIdPrecedes(xid, cutoff_xid))
+ xmin_frozen = TransactionIdPrecedes(xid, cutoff_xid);
+ if (xmin_frozen)
{
if (!TransactionIdDidCommit(xid))
ereport(ERROR,
@@ -6128,7 +6129,6 @@ heap_prepare_freeze_tuple(HeapTupleHeader tuple,
frz->t_infomask |= HEAP_XMIN_FROZEN;
changed = true;
- xmin_frozen = true;
}
}
--
2.17.1
--6c2NcOVqGQ03X4Wi--
view thread (2+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: [PATCH] heap_prepare_freeze_tuple: Simplify coding
In-Reply-To: <no-message-id-1883090@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox