Re: [sqlsmith] Planner error on lateral joins

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andreas Seltenreich <seltenreich@gmx.de>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2020-11-30T02:18:15Z
Lists: pgsql-hackers

Attachments

I wrote:
> Andreas Seltenreich <seltenreich@gmx.de> writes:
>> testing with sqlsmith on master at 3df51ca8b3 produced one instance of
>> the following error:
>> ERROR:  failed to build any 6-way joins

> Thanks for the test case!  The attached modification to use only
> longstanding test tables fails back to 9.5, but succeeds in 9.4.
> I've not tried to bisect yet.

Seems to be a missed consideration in add_placeholders_to_joinrel.
The attached fixes it for me.

			regards, tom lane

Commits

  1. Fix miscomputation of direct_lateral_relids for join relations.

  2. Undo mistaken tightening in join_is_legal().