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

Function pg_decode_commit_txn

contrib/test_decoding/test_decoding.c:320–345  ·  view source on GitHub ↗

COMMIT callback */

Source from the content-addressed store, hash-verified

318
319/* COMMIT callback */
320static void
321pg_decode_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
322 XLogRecPtr commit_lsn)
323{
324 TestDecodingData *data = ctx->output_plugin_private;
325 TestDecodingTxnData *txndata = txn->output_plugin_private;
326 bool xact_wrote_changes = txndata->xact_wrote_changes;
327
328 pfree(txndata);
329 txn->output_plugin_private = NULL;
330
331 if (data->skip_empty_xacts && !xact_wrote_changes)
332 return;
333
334 OutputPluginPrepareWrite(ctx, true);
335 if (data->include_xids)
336 appendStringInfo(ctx->out, "COMMIT %u", txn->xid);
337 else
338 appendStringInfoString(ctx->out, "COMMIT");
339
340 if (data->include_timestamp)
341 appendStringInfo(ctx->out, " (at %s)",
342 timestamptz_to_str(txn->commit_time));
343
344 OutputPluginWrite(ctx, true);
345}
346
347/* BEGIN PREPARE callback */
348static void

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