summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2023-03-17 08:29:41 +0530
committerAmit Kapila <akapila@postgresql.org>2023-03-17 08:29:41 +0530
commite709596b25bd184d6566dfff240e3f672a548afe (patch)
tree054a77f8afd6dd62ec3db67c452e9b78a5436b56 /contrib
parenteb7d043c9bbadb75a87385113c578f1b30e9d195 (diff)
downloadpostgresql-e709596b25bd184d6566dfff240e3f672a548afe.tar.gz
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
Diffstat (limited to 'contrib')
-rw-r--r--contrib/test_decoding/test_decoding.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c
index b7e6048647..628c6a2595 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);