Re: pgsql: Fix planner's use of Result Cache with unique joins - Mailing list pgsql-committers

From David Rowley
Subject Re: pgsql: Fix planner's use of Result Cache with unique joins
Date
Msg-id CAApHDvr9vaZ1+_Oeg5YJVBRqCsGOnu2RPBpoPVNtwVigDmFQOg@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Fix planner's use of Result Cache with unique joins  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Mon, 24 May 2021 at 02:14, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Coverity is not happy with this:

> This complaint is triggered because elsewhere in the same function,
> you're careful to check for inner_path->param_info being null before
> trying to dereference it:
>
>     if ((inner_path->param_info == NULL ||
>          inner_path->param_info->ppi_clauses == NIL) &&
>         innerrel->lateral_vars == NIL)
>         return NULL;
>
> Coverity reasons that it's probably a bug that you didn't do the same
> here; and I think it's right.

Yeah, I think that should be fixed. Thanks for reporting.

I propose the attached.  I think if the restrictlist is empty then we
needn't bother trying Result Cache.

David

Attachment

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Re-order pg_attribute columns to eliminate some padding space.
Next
From: David Rowley
Date:
Subject: pgsql: Add missing NULL check when building Result Cache paths