From e709596b25bd184d6566dfff240e3f672a548afe Mon Sep 17 00:00:00 2001 From: Amit Kapila Date: Fri, 17 Mar 2023 08:29:41 +0530 Subject: Add macros for ReorderBufferTXN toptxn. Currently, there are quite a few places in reorderbuffer.c that tries to access top-transaction for a subtransaction. This makes the code to access top-transaction consistent and easier to follow. Author: Peter Smith Reviewed-by: Vignesh C, Sawada Masahiko Discussion: https://postgr.es/m/CAHut+PuCznOyTqBQwjRUu-ibG-=KHyCv-0FTcWQtZUdR88umfg@mail.gmail.com --- contrib/test_decoding/test_decoding.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/test_decoding/test_decoding.c') diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c index b7e60486474..628c6a25957 100644 --- a/contrib/test_decoding/test_decoding.c +++ b/contrib/test_decoding/test_decoding.c @@ -815,11 +815,11 @@ pg_decode_stream_abort(LogicalDecodingContext *ctx, * maintain the output_plugin_private only under the toptxn so if this is * not the toptxn then fetch the toptxn. */ - ReorderBufferTXN *toptxn = txn->toptxn ? txn->toptxn : txn; + ReorderBufferTXN *toptxn = rbtxn_get_toptxn(txn); TestDecodingTxnData *txndata = toptxn->output_plugin_private; bool xact_wrote_changes = txndata->xact_wrote_changes; - if (txn->toptxn == NULL) + if (rbtxn_is_toptxn(txn)) { Assert(txn->output_plugin_private != NULL); pfree(txndata); -- cgit v1.2.3