diff options
author | Amit Kapila <akapila@postgresql.org> | 2023-03-17 08:29:41 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2023-03-17 08:29:41 +0530 |
commit | e709596b25bd184d6566dfff240e3f672a548afe (patch) | |
tree | 054a77f8afd6dd62ec3db67c452e9b78a5436b56 /src/backend/replication/pgoutput/pgoutput.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 'src/backend/replication/pgoutput/pgoutput.c')
-rw-r--r-- | src/backend/replication/pgoutput/pgoutput.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c index 00a2d73dab0..3a2d2e357e0 100644 --- a/src/backend/replication/pgoutput/pgoutput.c +++ b/src/backend/replication/pgoutput/pgoutput.c @@ -694,8 +694,8 @@ maybe_send_schema(LogicalDecodingContext *ctx, if (in_streaming) xid = change->txn->xid; - if (change->txn->toptxn) - topxid = change->txn->toptxn->xid; + if (rbtxn_is_subtxn(change->txn)) + topxid = rbtxn_get_toptxn(change->txn)->xid; else topxid = xid; @@ -1879,7 +1879,7 @@ pgoutput_stream_abort(struct LogicalDecodingContext *ctx, Assert(!in_streaming); /* determine the toplevel transaction */ - toptxn = (txn->toptxn) ? txn->toptxn : txn; + toptxn = rbtxn_get_toptxn(txn); Assert(rbtxn_is_streamed(toptxn)); |