Re: Compiler warnings - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: Compiler warnings
Date
Msg-id 20161129152538.GS13284@tamriel.snowman.net
Whole thread Raw
In response to Compiler warnings  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
* Stephen Frost (sfrost@snowman.net) wrote:
> diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c
> new file mode 100644
> index 884cdab..b5d97c8
> *** a/src/backend/utils/cache/plancache.c
> --- b/src/backend/utils/cache/plancache.c
> *************** GetCachedPlan(CachedPlanSource *plansour
> *** 1196,1204 ****
>                */
>               qlist = NIL;
>           }
> !     }
> !
> !     if (customplan)
>       {
>           /* Build a custom plan */
>           plan = BuildCachedPlan(plansource, qlist, boundParams);
> --- 1196,1203 ----
>                */
>               qlist = NIL;
>           }
> !     }
> !     else
>       {
>           /* Build a custom plan */
>           plan = BuildCachedPlan(plansource, qlist, boundParams);

Meh, of course this isn't correct since we could change 'customplan'
inside the first if() block to be true, the right answer is really to
just do:

CachedPlan *plan = NULL;

at the top and keep it simple.

ENEEDMORECOFFEE.

Thanks!

Stephen

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Compiler warnings
Next
From: Robert Haas
Date:
Subject: Re: Dynamic shared memory areas