Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fba6df0

Browse files
committed
add some annotations to pd_xid_base decoding
1 parent 99130d5 commit fba6df0

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/backend/access/rmgrdesc/heapdesc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ heap_desc(StringInfo buf, XLogReaderState *record)
5656
{
5757
xl_heap_update *xlrec;
5858

59+
/* step over pd_xid_base */
5960
if (isinit)
6061
rec += sizeof(TransactionId);
6162

src/backend/replication/logical/decode.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,11 @@ DecodeInsert(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
778778
Pointer rec_data;
779779

780780
rec_data = (Pointer) XLogRecGetData(r);
781+
782+
/* step over pd_xid_base */
781783
if (isinit)
782784
rec_data += sizeof(TransactionId);
785+
783786
xlrec = (xl_heap_insert *) rec_data;
784787

785788
/* only interested in our database */
@@ -835,8 +838,11 @@ DecodeUpdate(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
835838
Pointer rec_data;
836839

837840
rec_data = (Pointer) XLogRecGetData(r);
841+
842+
/* step over pd_xid_base */
838843
if (isinit)
839844
rec_data += sizeof(TransactionId);
845+
840846
xlrec = (xl_heap_update *) rec_data;
841847

842848
/* only interested in our database */
@@ -876,6 +882,8 @@ DecodeUpdate(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
876882
/* caution, remaining data in record is not aligned */
877883
data = XLogRecGetData(r) + SizeOfHeapUpdate;
878884
datalen = XLogRecGetDataLen(r) - SizeOfHeapUpdate;
885+
886+
/* step over pd_xid_base */
879887
if (isinit)
880888
{
881889
data += sizeof(TransactionId);
@@ -970,8 +978,11 @@ DecodeMultiInsert(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
970978
Pointer rec_data;
971979

972980
rec_data = (Pointer) XLogRecGetData(r);
981+
982+
/* step over pd_xid_base */
973983
if (isinit)
974984
rec_data += sizeof(TransactionId);
985+
975986
xlrec = (xl_heap_multi_insert *) rec_data;
976987

977988
/* only interested in our database */

0 commit comments

Comments
 (0)