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 1ozg8j-0003oU-Hp for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Nov 2022 15:33:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozg8i-0004R6-9Y for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Nov 2022 15:33:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozg8i-0004PT-0z for pgsql-bugs@lists.postgresql.org; Mon, 28 Nov 2022 15:33:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozg8b-0006Ke-F6 for pgsql-bugs@lists.postgresql.org; Mon, 28 Nov 2022 15:33:44 +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 2ASFXbWx556195; Mon, 28 Nov 2022 10:33:37 -0500 From: Tom Lane To: Richard Guo cc: xinwen@stu.scu.edu.cn, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17700: An assert failed in prepjointree.c In-reply-to: References: <17700-2b5c10d917c30687@postgresql.org> Comments: In-reply-to Richard Guo message dated "Mon, 28 Nov 2022 20:32:15 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <556193.1669649617.1@sss.pgh.pa.us> Date: Mon, 28 Nov 2022 10:33:37 -0500 Message-ID: <556194.1669649617@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > I haven't got too much time looking into it. But the comment near the > assertion failure that says > * Unlike the LEFT/RIGHT cases, we just Assert that there are > * no PHVs that need to be evaluated at the semijoin's RHS, > * since the rest of the query couldn't reference any outputs > * of the semijoin's RHS. > I doubt this is true as a semijoin's qual can actually reference its > RHS. In this case the assertion failure happens because there is PHV in > the join's qual. Yeah, the possibility of a PHV in the qual refutes that argument. So we need to make the test honestly, as in the other arms of that switch. Will fix. regards, tom lane