Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdfdb2f3

Browse files
committed
test_decoding: Add comments about delaying BEGIN/PREPARE
It is not immediately obvious why we return early in these functions;these comments should make it so.Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>Discussion:https://postgr.es/m/202202141336.xv35beswc6ec@alvherre.pgsql
1 parent68d8f9b commitdfdb2f3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎contrib/test_decoding/test_decoding.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ pg_decode_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
322322
txndata->xact_wrote_changes= false;
323323
txn->output_plugin_private=txndata;
324324

325+
/*
326+
* If asked to skip empty transactions, we'll emit BEGIN at the point where
327+
* the first operation is received for this transaction.
328+
*/
325329
if (data->skip_empty_xacts)
326330
return;
327331

@@ -378,6 +382,10 @@ pg_decode_begin_prepare_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
378382
txndata->xact_wrote_changes= false;
379383
txn->output_plugin_private=txndata;
380384

385+
/*
386+
* If asked to skip empty transactions, we'll emit BEGIN at the point where
387+
* the first operation is received for this transaction.
388+
*/
381389
if (data->skip_empty_xacts)
382390
return;
383391

@@ -392,6 +400,10 @@ pg_decode_prepare_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
392400
TestDecodingData*data=ctx->output_plugin_private;
393401
TestDecodingTxnData*txndata=txn->output_plugin_private;
394402

403+
/*
404+
* If asked to skip empty transactions, we'll emit PREPARE at the point
405+
* where the first operation is received for this transaction.
406+
*/
395407
if (data->skip_empty_xacts&& !txndata->xact_wrote_changes)
396408
return;
397409

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp