Skip to content

Commit 12594a3

Browse files
author
Marina Polyakova
committed
Fix compiler warnings due to new checks in PostgreSQL 16
See the commit 0fe954c28584169938e5c0738cfaa9930ce77577 (Add -Wshadow=compatible-local to the standard compilation flags) in PostgreSQL 16.
1 parent 4e8efb7 commit 12594a3

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

src/partition_creation.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -2027,11 +2027,9 @@ build_partitioning_expression(Oid parent_relid,
20272027
/* We need expression type for hash functions */
20282028
if (expr_type)
20292029
{
2030-
Node *expr;
2031-
expr = cook_partitioning_expression(parent_relid, expr_cstr, NULL);
2032-
20332030
/* Finally return expression type */
2034-
*expr_type = exprType(expr);
2031+
*expr_type = exprType(
2032+
cook_partitioning_expression(parent_relid, expr_cstr, NULL));
20352033
}
20362034

20372035
if (columns)

src/relation_info.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -71,34 +71,34 @@ int prel_resowner_line = 0;
7171

7272
#define LeakTrackerAdd(prel) \
7373
do { \
74-
MemoryContext old_mcxt = MemoryContextSwitchTo((prel)->mcxt); \
74+
MemoryContext leak_tracker_add_old_mcxt = MemoryContextSwitchTo((prel)->mcxt); \
7575
(prel)->owners = \
7676
list_append_unique( \
7777
(prel)->owners, \
7878
list_make2(makeString((char *) prel_resowner_function), \
7979
makeInteger(prel_resowner_line))); \
80-
MemoryContextSwitchTo(old_mcxt); \
80+
MemoryContextSwitchTo(leak_tracker_add_old_mcxt); \
8181
\
8282
(prel)->access_total++; \
8383
} while (0)
8484

8585
#define LeakTrackerPrint(prel) \
8686
do { \
87-
ListCell *lc; \
88-
foreach (lc, (prel)->owners) \
87+
ListCell *leak_tracker_print_lc; \
88+
foreach (leak_tracker_print_lc, (prel)->owners) \
8989
{ \
90-
char *fun = strVal(linitial(lfirst(lc))); \
91-
int line = intVal(lsecond(lfirst(lc))); \
90+
char *fun = strVal(linitial(lfirst(leak_tracker_print_lc))); \
91+
int line = intVal(lsecond(lfirst(leak_tracker_print_lc))); \
9292
elog(WARNING, "PartRelationInfo referenced in %s:%d", fun, line); \
9393
} \
9494
} while (0)
9595

9696
#define LeakTrackerFree(prel) \
9797
do { \
98-
ListCell *lc; \
99-
foreach (lc, (prel)->owners) \
98+
ListCell *leak_tracker_free_lc; \
99+
foreach (leak_tracker_free_lc, (prel)->owners) \
100100
{ \
101-
list_free_deep(lfirst(lc)); \
101+
list_free_deep(lfirst(leak_tracker_free_lc)); \
102102
} \
103103
list_free((prel)->owners); \
104104
(prel)->owners = NIL; \

src/runtime_merge_append.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ fetch_next_tuple(CustomScanState *node)
374374
for (i = 0; i < scan_state->rstate.ncur_plans; i++)
375375
{
376376
ChildScanCommon child = scan_state->rstate.cur_plans[i];
377-
PlanState *ps = child->content.plan_state;
377+
378+
ps = child->content.plan_state;
378379

379380
Assert(child->content_type == CHILD_PLAN_STATE);
380381

@@ -721,10 +722,11 @@ prepare_sort_from_pathkeys(PlannerInfo *root, Plan *lefttree, List *pathkeys,
721722

722723
foreach(j, ec->ec_members)
723724
{
724-
EquivalenceMember *em = (EquivalenceMember *) lfirst(j);
725725
List *exprvars;
726726
ListCell *k;
727727

728+
em = (EquivalenceMember *) lfirst(j);
729+
728730
/*
729731
* We shouldn't be trying to sort by an equivalence class that
730732
* contains a constant, so no need to consider such cases any

0 commit comments

Comments
 (0)