MCPcopy Create free account
hub / github.com/apache/cloudberry / pg_decode_stream_commit

Function pg_decode_stream_commit

contrib/test_decoding/test_decoding.c:861–888  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859}
860
861static void
862pg_decode_stream_commit(LogicalDecodingContext *ctx,
863 ReorderBufferTXN *txn,
864 XLogRecPtr commit_lsn)
865{
866 TestDecodingData *data = ctx->output_plugin_private;
867 TestDecodingTxnData *txndata = txn->output_plugin_private;
868 bool xact_wrote_changes = txndata->xact_wrote_changes;
869
870 pfree(txndata);
871 txn->output_plugin_private = NULL;
872
873 if (data->skip_empty_xacts && !xact_wrote_changes)
874 return;
875
876 OutputPluginPrepareWrite(ctx, true);
877
878 if (data->include_xids)
879 appendStringInfo(ctx->out, "committing streamed transaction TXN %u", txn->xid);
880 else
881 appendStringInfoString(ctx->out, "committing streamed transaction");
882
883 if (data->include_timestamp)
884 appendStringInfo(ctx->out, " (at %s)",
885 timestamptz_to_str(txn->commit_time));
886
887 OutputPluginWrite(ctx, true);
888}
889
890/*
891 * In streaming mode, we don't display the changes as the transaction can abort

Callers

nothing calls this directly

Calls 6

OutputPluginPrepareWriteFunction · 0.85
appendStringInfoFunction · 0.85
appendStringInfoStringFunction · 0.85
OutputPluginWriteFunction · 0.85
pfreeFunction · 0.50
timestamptz_to_strFunction · 0.50

Tested by

no test coverage detected