diff options
Diffstat (limited to 'src/include/replication/reorderbuffer.h')
-rw-r--r-- | src/include/replication/reorderbuffer.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/replication/reorderbuffer.h b/src/include/replication/reorderbuffer.h index 215d1494e90..e37f5120ebb 100644 --- a/src/include/replication/reorderbuffer.h +++ b/src/include/replication/reorderbuffer.h @@ -249,6 +249,24 @@ typedef struct ReorderBufferChange ((txn)->txn_flags & RBTXN_SKIPPED_PREPARE) != 0 \ ) +/* Is this a top-level transaction? */ +#define rbtxn_is_toptxn(txn) \ +( \ + (txn)->toptxn == NULL \ +) + +/* Is this a subtransaction? */ +#define rbtxn_is_subtxn(txn) \ +( \ + (txn)->toptxn != NULL \ +) + +/* Get the top-level transaction of this (sub)transaction. */ +#define rbtxn_get_toptxn(txn) \ +( \ + rbtxn_is_subtxn(txn) ? (txn)->toptxn : (txn) \ +) + typedef struct ReorderBufferTXN { /* See above */ |