61
61
#endif
62
62
63
63
#if PG_VERSION_NUM >= 170000
64
- #define TUPLE_ACCESS
64
+ #define TUPLE_ACCESS ( x ) x
65
65
#else
66
- #define TUPLE_ACCESS ->tuple
66
+ #define TUPLE_ACCESS ( x ) &x ->tuple
67
67
#endif
68
68
69
69
PG_MODULE_MAGIC ;
@@ -628,13 +628,13 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
628
628
rmsg .new_tuple =
629
629
palloc (sizeof (Decoderbufs__DatumMessage * ) * rmsg .n_new_tuple );
630
630
tuple_to_tuple_msg (rmsg .new_tuple , relation ,
631
- & change -> data .tp .newtuple TUPLE_ACCESS , tupdesc );
631
+ TUPLE_ACCESS ( change -> data .tp .newtuple ) , tupdesc );
632
632
633
633
rmsg .n_new_typeinfo = rmsg .n_new_tuple ;
634
634
rmsg .new_typeinfo =
635
635
palloc (sizeof (Decoderbufs__TypeInfo * ) * rmsg .n_new_typeinfo );
636
636
add_metadata_to_msg (rmsg .new_typeinfo , relation ,
637
- & change -> data .tp .newtuple TUPLE_ACCESS , tupdesc );
637
+ TUPLE_ACCESS ( change -> data .tp .newtuple ) , tupdesc );
638
638
}
639
639
break ;
640
640
case REORDER_BUFFER_CHANGE_UPDATE :
@@ -649,7 +649,7 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
649
649
rmsg .old_tuple =
650
650
palloc (sizeof (Decoderbufs__DatumMessage * ) * rmsg .n_old_tuple );
651
651
tuple_to_tuple_msg (rmsg .old_tuple , relation ,
652
- & change -> data .tp .oldtuple TUPLE_ACCESS , tupdesc );
652
+ TUPLE_ACCESS ( change -> data .tp .oldtuple ) , tupdesc );
653
653
}
654
654
if (change -> data .tp .newtuple != NULL ) {
655
655
elog (DEBUG1 , "decoding new tuple information" );
@@ -659,13 +659,13 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
659
659
rmsg .new_tuple =
660
660
palloc (sizeof (Decoderbufs__DatumMessage * ) * rmsg .n_new_tuple );
661
661
tuple_to_tuple_msg (rmsg .new_tuple , relation ,
662
- & change -> data .tp .newtuple TUPLE_ACCESS , tupdesc );
662
+ TUPLE_ACCESS ( change -> data .tp .newtuple ) , tupdesc );
663
663
664
664
rmsg .n_new_typeinfo = rmsg .n_new_tuple ;
665
665
rmsg .new_typeinfo =
666
666
palloc (sizeof (Decoderbufs__TypeInfo * ) * rmsg .n_new_typeinfo );
667
667
add_metadata_to_msg (rmsg .new_typeinfo , relation ,
668
- & change -> data .tp .newtuple TUPLE_ACCESS , tupdesc );
668
+ TUPLE_ACCESS ( change -> data .tp .newtuple ) , tupdesc );
669
669
}
670
670
}
671
671
break ;
@@ -681,7 +681,7 @@ static void pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
681
681
rmsg .old_tuple =
682
682
palloc (sizeof (Decoderbufs__DatumMessage * ) * rmsg .n_old_tuple );
683
683
tuple_to_tuple_msg (rmsg .old_tuple , relation ,
684
- & change -> data .tp .oldtuple TUPLE_ACCESS , tupdesc );
684
+ TUPLE_ACCESS ( change -> data .tp .oldtuple ) , tupdesc );
685
685
} else {
686
686
elog (DEBUG1 , "no information to decode from DELETE because either no PK is present or REPLICA IDENTITY NOTHING or invalid " );
687
687
}
0 commit comments