diff options
author | Amit Kapila | 2023-03-17 02:59:41 +0000 |
---|---|---|
committer | Amit Kapila | 2023-03-17 02:59:41 +0000 |
commit | e709596b25bd184d6566dfff240e3f672a548afe (patch) | |
tree | 054a77f8afd6dd62ec3db67c452e9b78a5436b56 /contrib/test_decoding/test_decoding.c | |
parent | eb7d043c9bbadb75a87385113c578f1b30e9d195 (diff) |
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/test_decoding/test_decoding.c')
-rw-r--r-- | contrib/test_decoding/test_decoding.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |