summaryrefslogtreecommitdiff
path: root/src/backend/replication/logical/reorderbuffer.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-09-30 12:24:15 +0200
committerPeter Eisentraut <peter@eisentraut.org>2025-09-30 12:35:50 +0200
commit57d46dff9b0ba8dc50fb37166373ea7638ecd2b9 (patch)
tree8a97758eea51b179496ffd5ee8283d88302a00e3 /src/backend/replication/logical/reorderbuffer.c
parent4b7e6c73b0df3384345052616727a25505db5fcb (diff)
Make some use of anonymous unions [reorderbuffer xact_time]
Make some use of anonymous unions, which are allowed as of C11, as examples and encouragement for future code, and to test compilers. This commit changes the ReorderBufferTXN struct. Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/f00a9968-388e-4f8c-b5ef-5102e962d997%40eisentraut.org
Diffstat (limited to 'src/backend/replication/logical/reorderbuffer.c')
-rw-r--r--src/backend/replication/logical/reorderbuffer.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/replication/logical/reorderbuffer.c b/src/backend/replication/logical/reorderbuffer.c
index 4736f993c37..a5e165fb123 100644
--- a/src/backend/replication/logical/reorderbuffer.c
+++ b/src/backend/replication/logical/reorderbuffer.c
@@ -2830,7 +2830,7 @@ ReorderBufferReplay(ReorderBufferTXN *txn,
txn->final_lsn = commit_lsn;
txn->end_lsn = end_lsn;
- txn->xact_time.commit_time = commit_time;
+ txn->commit_time = commit_time;
txn->origin_id = origin_id;
txn->origin_lsn = origin_lsn;
@@ -2922,7 +2922,7 @@ ReorderBufferRememberPrepareInfo(ReorderBuffer *rb, TransactionId xid,
*/
txn->final_lsn = prepare_lsn;
txn->end_lsn = end_lsn;
- txn->xact_time.prepare_time = prepare_time;
+ txn->prepare_time = prepare_time;
txn->origin_id = origin_id;
txn->origin_lsn = origin_lsn;
@@ -2979,7 +2979,7 @@ ReorderBufferPrepare(ReorderBuffer *rb, TransactionId xid,
txn->gid = pstrdup(gid);
ReorderBufferReplay(txn, rb, xid, txn->final_lsn, txn->end_lsn,
- txn->xact_time.prepare_time, txn->origin_id, txn->origin_lsn);
+ txn->prepare_time, txn->origin_id, txn->origin_lsn);
/*
* Send a prepare if not already done so. This might occur if we have
@@ -3018,7 +3018,7 @@ ReorderBufferFinishPrepared(ReorderBuffer *rb, TransactionId xid,
* be later used for rollback.
*/
prepare_end_lsn = txn->end_lsn;
- prepare_time = txn->xact_time.prepare_time;
+ prepare_time = txn->prepare_time;
/* add the gid in the txn */
txn->gid = pstrdup(gid);
@@ -3050,12 +3050,12 @@ ReorderBufferFinishPrepared(ReorderBuffer *rb, TransactionId xid,
* prepared after the restart.
*/
ReorderBufferReplay(txn, rb, xid, txn->final_lsn, txn->end_lsn,
- txn->xact_time.prepare_time, txn->origin_id, txn->origin_lsn);
+ txn->prepare_time, txn->origin_id, txn->origin_lsn);
}
txn->final_lsn = commit_lsn;
txn->end_lsn = end_lsn;
- txn->xact_time.commit_time = commit_time;
+ txn->commit_time = commit_time;
txn->origin_id = origin_id;
txn->origin_lsn = origin_lsn;
@@ -3095,7 +3095,7 @@ ReorderBufferAbort(ReorderBuffer *rb, TransactionId xid, XLogRecPtr lsn,
if (txn == NULL)
return;
- txn->xact_time.abort_time = abort_time;
+ txn->abort_time = abort_time;
/* For streamed transactions notify the remote node about the abort. */
if (rbtxn_is_streamed(txn))