]> granicus.if.org Git - postgresql/commitdiff
Fix thinko in logical decoding of commit-prepared records.
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 16 May 2014 07:53:10 +0000 (10:53 +0300)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 16 May 2014 07:53:10 +0000 (10:53 +0300)
The decoding of prepared transaction commits accidentally used the XID of
the transaction performing the COMMIT PREPARED, not the XID of the prepared
transaction. Before bb38fb0d43c8d that lead to those transactions not being
decoded, afterwards to a assertion failure.

src/backend/replication/logical/decode.c

index 7b6114a2097a3664288bdea80795c7f227dd1452..cc736521c2a416c3c9ef70f61e6719c7b15d7f48 100644 (file)
@@ -225,7 +225,7 @@ DecodeXactOp(LogicalDecodingContext *ctx, XLogRecordBuffer *buf)
                                subxacts = (TransactionId *) &(xlrec->xnodes[xlrec->nrels]);
                                invals = (SharedInvalidationMessage *) &(subxacts[xlrec->nsubxacts]);
 
-                               DecodeCommit(ctx, buf, r->xl_xid, xlrec->dbId,
+                               DecodeCommit(ctx, buf, prec->xid, xlrec->dbId,
                                                         xlrec->xact_time,
                                                         xlrec->nsubxacts, subxacts,
                                                         xlrec->nmsgs, invals);