param 'txn' not used in function maybe_send_schema()
Hi,
When reviewing logicalreplication related patches, I noticed the function
param ReorderBufferTXN *txn not used in the function maybe_send_schema(). Since
this is not an external function, I think it might be better to remove the unused paramater.
Best regards,
Houzj
Attachments:
0001-remove-unused-paramter-in-maybe_send_schema.patchapplication/octet-stream; name=0001-remove-unused-paramter-in-maybe_send_schema.patchDownload
From b2b025240555f59fbe6d13fe08b318c504547bb5 Mon Sep 17 00:00:00 2001
From: Hou Zhijie <HouZhijie@foxmail.com>
Date: Fri, 30 Jul 2021 20:53:56 +0800
Subject: [PATCH] remove unused paramter in maybe_send_schema
---
src/backend/replication/pgoutput/pgoutput.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index e4314af13a..3574a11749 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -503,7 +503,7 @@ pgoutput_rollback_prepared_txn(LogicalDecodingContext *ctx,
*/
static void
maybe_send_schema(LogicalDecodingContext *ctx,
- ReorderBufferTXN *txn, ReorderBufferChange *change,
+ ReorderBufferChange *change,
Relation relation, RelationSyncEntry *relentry)
{
bool schema_sent;
@@ -680,7 +680,7 @@ pgoutput_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
/* Avoid leaking memory by using and resetting our own context */
old = MemoryContextSwitchTo(data->context);
- maybe_send_schema(ctx, txn, change, relation, relentry);
+ maybe_send_schema(ctx, change, relation, relentry);
/* Send the data */
switch (change->action)
@@ -817,7 +817,7 @@ pgoutput_truncate(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
continue;
relids[nrelids++] = relid;
- maybe_send_schema(ctx, txn, change, relation, relentry);
+ maybe_send_schema(ctx, change, relation, relentry);
}
if (nrelids > 0)
--
2.27.0
On 2021/07/30 22:27, houzj.fnst@fujitsu.com wrote:
Hi,
When reviewing logicalreplication related patches, I noticed the function
param ReorderBufferTXN *txn not used in the function maybe_send_schema(). Since
this is not an external function, I think it might be better to remove the unused paramater.
+1
Seems commit 464824323e accidentally added the argument though
it's not used in maybe_send_schema(). I *guess* that it was used
in the patches in dev early stage, but it's changed so that no longer used
while it's being reviewed. But maybe we forgot to remove it.
Barring any objection, I will commit the patch.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION