| 798 | } |
| 799 | |
| 800 | static void |
| 801 | pg_decode_stream_abort(LogicalDecodingContext *ctx, |
| 802 | ReorderBufferTXN *txn, |
| 803 | XLogRecPtr abort_lsn) |
| 804 | { |
| 805 | TestDecodingData *data = ctx->output_plugin_private; |
| 806 | |
| 807 | /* |
| 808 | * stream abort can be sent for an individual subtransaction but we |
| 809 | * maintain the output_plugin_private only under the toptxn so if this is |
| 810 | * not the toptxn then fetch the toptxn. |
| 811 | */ |
| 812 | ReorderBufferTXN *toptxn = txn->toptxn ? txn->toptxn : txn; |
| 813 | TestDecodingTxnData *txndata = toptxn->output_plugin_private; |
| 814 | bool xact_wrote_changes = txndata->xact_wrote_changes; |
| 815 | |
| 816 | if (txn->toptxn == NULL) |
| 817 | { |
| 818 | Assert(txn->output_plugin_private != NULL); |
| 819 | pfree(txndata); |
| 820 | txn->output_plugin_private = NULL; |
| 821 | } |
| 822 | |
| 823 | if (data->skip_empty_xacts && !xact_wrote_changes) |
| 824 | return; |
| 825 | |
| 826 | OutputPluginPrepareWrite(ctx, true); |
| 827 | if (data->include_xids) |
| 828 | appendStringInfo(ctx->out, "aborting streamed (sub)transaction TXN %u", txn->xid); |
| 829 | else |
| 830 | appendStringInfoString(ctx->out, "aborting streamed (sub)transaction"); |
| 831 | OutputPluginWrite(ctx, true); |
| 832 | } |
| 833 | |
| 834 | static void |
| 835 | pg_decode_stream_prepare(LogicalDecodingContext *ctx, |
nothing calls this directly
no test coverage detected