Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjTUB-0003SC-JN for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Nov 2020 20:39:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kjTU9-0006HT-D4 for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Nov 2020 20:39:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjTU9-0006HM-63 for pgsql-hackers@lists.postgresql.org; Sun, 29 Nov 2020 20:39:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kjTU3-00032S-2F for pgsql-hackers@lists.postgresql.org; Sun, 29 Nov 2020 20:39:52 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 0ATKdgni1106992; Sun, 29 Nov 2020 15:39:42 -0500 From: Tom Lane To: Andreas Seltenreich cc: pgsql-hackers@lists.postgresql.org Subject: Re: [sqlsmith] Planner error on lateral joins In-reply-to: <87blfgqa4t.fsf@aurora.ydns.eu> References: <87blfgqa4t.fsf@aurora.ydns.eu> Comments: In-reply-to Andreas Seltenreich message dated "Sun, 29 Nov 2020 19:40:50 +0100" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <1106948.1606682332.0@sss.pgh.pa.us> Date: Sun, 29 Nov 2020 15:39:42 -0500 Message-ID: <1106991.1606682382@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1106948.1606682332.1@sss.pgh.pa.us> Andreas Seltenreich 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. regards, tom lane ------- =_aaaaaaaaaa0 Content-Type: text/plain; name="lateraljoinbug.sql"; charset="us-ascii" Content-ID: <1106948.1606682332.2@sss.pgh.pa.us> Content-Description: lateraljoinbug.sql select * from (select sample_1.f1 as c0 from int4_tbl as sample_1) as subq_0, lateral (select 1 from (select subq_0.c0 as c3, subq_5.c0 as c7, sample_2.q2 as c9 from int8_tbl as sample_2, lateral (select subq_3.c1 as c0 from int4_tbl as sample_3, lateral (select sample_2.q1 as c0, sample_3.f1 as c1 from public.rtest_interface as ref_0 ) as subq_1, lateral (select subq_1.c1 as c1 from int4_tbl as ref_1 ) as subq_3 ) as subq_5) as subq_6 right join int4_tbl as sample_6 on (true) where subq_6.c7 = subq_6.c3) as subq_7; ------- =_aaaaaaaaaa0--