Skip to content

Commit c252d37

Browse files
author
Amit Kapila
committed
Fix shadow variable warning in subscriptioncmds.c.
Author: Shlok Kyal <shlok.kyal.oss@gmail.com> Author: Peter Smith <smithpb2250@gmail.com> Reviewed-by: Chao Li <li.evan.chao@gmail.com> Reviewed-by: Vignesh C <vignesh21@gmail.com> Discussion: https://postgr.es/m/CAHut+PsF8R0Bt4J3c92+T2F0mun0rRfK=-GH+iBv2s-O8ahJJw@mail.gmail.com
1 parent a6d05c8 commit c252d37

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/commands/subscriptioncmds.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,10 +1122,10 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data,
11221122
* to be at the end because otherwise if there is an error while doing
11231123
* the database operations we won't be able to rollback dropped slots.
11241124
*/
1125-
foreach_ptr(SubRemoveRels, rel, sub_remove_rels)
1125+
foreach_ptr(SubRemoveRels, sub_remove_rel, sub_remove_rels)
11261126
{
1127-
if (rel->state != SUBREL_STATE_READY &&
1128-
rel->state != SUBREL_STATE_SYNCDONE)
1127+
if (sub_remove_rel->state != SUBREL_STATE_READY &&
1128+
sub_remove_rel->state != SUBREL_STATE_SYNCDONE)
11291129
{
11301130
char syncslotname[NAMEDATALEN] = {0};
11311131

@@ -1139,7 +1139,7 @@ AlterSubscription_refresh(Subscription *sub, bool copy_data,
11391139
* dropped slots and fail. For these reasons, we allow
11401140
* missing_ok = true for the drop.
11411141
*/
1142-
ReplicationSlotNameForTablesync(sub->oid, rel->relid,
1142+
ReplicationSlotNameForTablesync(sub->oid, sub_remove_rel->relid,
11431143
syncslotname, sizeof(syncslotname));
11441144
ReplicationSlotDropAtPubNode(wrconn, syncslotname, true);
11451145
}

0 commit comments

Comments
 (0)