From 51c4c49e81c802d74e348222df66fcff3b841814 Mon Sep 17 00:00:00 2001
From: Justin Pryzby <pryzbyj@telsasoft.com>
Date: Tue, 16 Aug 2022 19:01:16 -0500
Subject: [PATCH 05/26] avoid shadow vars: tablesync.c: slot

backpatch to v15

commit 923def9a533a7d986acfb524139d8b9e5466d0a5
Author: Tomas Vondra <tomas.vondra@postgresql.org>
Date:   Sat Mar 26 00:45:21 2022 +0100

    Allow specifying column lists for logical replication
---
 src/backend/replication/logical/tablesync.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c
index 71b503f4217..cfc47dc8df0 100644
--- a/src/backend/replication/logical/tablesync.c
+++ b/src/backend/replication/logical/tablesync.c
@@ -759,7 +759,7 @@ fetch_remote_table_info(char *nspname, char *relname,
 	if (walrcv_server_version(LogRepWorkerWalRcvConn) >= 150000)
 	{
 		WalRcvExecResult *pubres;
-		TupleTableSlot *slot;
+		TupleTableSlot *thisslot;
 		Oid			attrsRow[] = {INT2VECTOROID};
 		StringInfoData pub_names;
 
@@ -819,10 +819,10 @@ fetch_remote_table_info(char *nspname, char *relname,
 		 * If we find a NULL value, it means all the columns should be
 		 * replicated.
 		 */
-		slot = MakeSingleTupleTableSlot(pubres->tupledesc, &TTSOpsMinimalTuple);
-		if (tuplestore_gettupleslot(pubres->tuplestore, true, false, slot))
+		thisslot = MakeSingleTupleTableSlot(pubres->tupledesc, &TTSOpsMinimalTuple);
+		if (tuplestore_gettupleslot(pubres->tuplestore, true, false, thisslot))
 		{
-			Datum		cfval = slot_getattr(slot, 1, &isnull);
+			Datum		cfval = slot_getattr(thisslot, 1, &isnull);
 
 			if (!isnull)
 			{
@@ -838,9 +838,9 @@ fetch_remote_table_info(char *nspname, char *relname,
 					included_cols = bms_add_member(included_cols, elems[natt]);
 			}
 
-			ExecClearTuple(slot);
+			ExecClearTuple(thisslot);
 		}
-		ExecDropSingleTupleTableSlot(slot);
+		ExecDropSingleTupleTableSlot(thisslot);
 
 		walrcv_clear_result(pubres);
 
-- 
2.17.1

