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

Function pg_decode_prepare_txn

contrib/test_decoding/test_decoding.c:365–388  ·  view source on GitHub ↗

PREPARE callback */

Source from the content-addressed store, hash-verified

363
364/* PREPARE callback */
365static void
366pg_decode_prepare_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
367 XLogRecPtr prepare_lsn)
368{
369 TestDecodingData *data = ctx->output_plugin_private;
370 TestDecodingTxnData *txndata = txn->output_plugin_private;
371
372 if (data->skip_empty_xacts && !txndata->xact_wrote_changes)
373 return;
374
375 OutputPluginPrepareWrite(ctx, true);
376
377 appendStringInfo(ctx->out, "PREPARE TRANSACTION %s",
378 quote_literal_cstr(txn->gid));
379
380 if (data->include_xids)
381 appendStringInfo(ctx->out, ", txid %u", txn->xid);
382
383 if (data->include_timestamp)
384 appendStringInfo(ctx->out, " (at %s)",
385 timestamptz_to_str(txn->commit_time));
386
387 OutputPluginWrite(ctx, true);
388}
389
390/* COMMIT PREPARED callback */
391static void

Callers

nothing calls this directly

Calls 5

OutputPluginPrepareWriteFunction · 0.85
appendStringInfoFunction · 0.85
quote_literal_cstrFunction · 0.85
OutputPluginWriteFunction · 0.85
timestamptz_to_strFunction · 0.50

Tested by

no test coverage detected