Skip to content

Commit

Permalink
Fix two warnings produced by -Wshadow=compatible-local
Browse files Browse the repository at this point in the history
Upstream PostgreSQL has added this switch to the standard compilation
flags as of 0fe954c, hence trying to compile pg_hint_plan with upstream
from this commit would cause those warnings.  These are fixed by
renaming the existing variables shadowing the others.

Pull request yugabyte#108

Reviewed-by: Julien Rouhaud
  • Loading branch information
michaelpq committed Dec 10, 2022
1 parent 005264a commit 818fe9a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pg_hint_plan.c
Original file line number Diff line number Diff line change
Expand Up @@ -4624,9 +4624,9 @@ pg_hint_plan_join_search(PlannerInfo *root, int levels_needed,
foreach (lc, initial_rels)
{
ListCell *lcp;
RelOptInfo *rel = (RelOptInfo *) lfirst(lc);
RelOptInfo *initrel = (RelOptInfo *) lfirst(lc);

foreach (lcp, rel->partial_pathlist)
foreach (lcp, initrel->partial_pathlist)
{
Path *path = (Path *) lfirst(lcp);

Expand Down Expand Up @@ -4732,11 +4732,11 @@ pg_hint_plan_set_rel_pathlist(PlannerInfo * root, RelOptInfo *rel,

if (inhibit_nonparallel)
{
ListCell *lc;
ListCell *lcr;

foreach(lc, rel->pathlist)
foreach(lcr, rel->pathlist)
{
Path *path = (Path *) lfirst(lc);
Path *path = (Path *) lfirst(lcr);

if (path->startup_cost < disable_cost)
{
Expand Down

0 comments on commit 818fe9a

Please sign in to comment.