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

Function pg_decode_stream_change

contrib/test_decoding/test_decoding.c:895–917  ·  view source on GitHub ↗

* In streaming mode, we don't display the changes as the transaction can abort * at a later point in time. We don't want users to see the changes until the * transaction is committed. */

Source from the content-addressed store, hash-verified

893 * transaction is committed.
894 */
895static void
896pg_decode_stream_change(LogicalDecodingContext *ctx,
897 ReorderBufferTXN *txn,
898 Relation relation,
899 ReorderBufferChange *change)
900{
901 TestDecodingData *data = ctx->output_plugin_private;
902 TestDecodingTxnData *txndata = txn->output_plugin_private;
903
904 /* output stream start if we haven't yet */
905 if (data->skip_empty_xacts && !txndata->stream_wrote_changes)
906 {
907 pg_output_stream_start(ctx, data, txn, false);
908 }
909 txndata->xact_wrote_changes = txndata->stream_wrote_changes = true;
910
911 OutputPluginPrepareWrite(ctx, true);
912 if (data->include_xids)
913 appendStringInfo(ctx->out, "streaming change for TXN %u", txn->xid);
914 else
915 appendStringInfoString(ctx->out, "streaming change for transaction");
916 OutputPluginWrite(ctx, true);
917}
918
919/*
920 * In streaming mode, we don't display the contents for transactional messages

Callers

nothing calls this directly

Calls 5

pg_output_stream_startFunction · 0.85
OutputPluginPrepareWriteFunction · 0.85
appendStringInfoFunction · 0.85
appendStringInfoStringFunction · 0.85
OutputPluginWriteFunction · 0.85

Tested by

no test coverage detected