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 1oIbzq-00050m-Gq for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Aug 2022 20:26:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oIbzp-0006Je-5i for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Aug 2022 20:26:37 +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 1oIbzo-0006JV-SP for pgsql-hackers@lists.postgresql.org; Mon, 01 Aug 2022 20:26:36 +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 1oIbzm-0006lY-OK for pgsql-hackers@lists.postgresql.org; Mon, 01 Aug 2022 20:26:36 +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 271KQUkx2070643; Mon, 1 Aug 2022 16:26:30 -0400 From: Tom Lane To: Zhihong Yu cc: PostgreSQL Developers , Richard Guo , "Finnerty, Jim" Subject: Re: Making Vars outer-join aware In-reply-to: References: <830269.1656693747@sss.pgh.pa.us> <1903934.1657031040@sss.pgh.pa.us> <553080.1657481916@sss.pgh.pa.us> <1515100.1657633061@sss.pgh.pa.us> <2217146.1657721363@sss.pgh.pa.us> <2055912.1659383493@sss.pgh.pa.us> Comments: In-reply-to Zhihong Yu message dated "Mon, 01 Aug 2022 13:28:37 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2070641.1659385590.1@sss.pgh.pa.us> Date: Mon, 01 Aug 2022 16:26:30 -0400 Message-ID: <2070642.1659385590@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Zhihong Yu writes: > For v3-0003-label-Var-nullability-in-parser.patch : > + if (rtindex > 0 && rtindex <= list_length(pstate->p_nullingrels)) > + relids = (Bitmapset *) list_nth(pstate->p_nullingrels, rtindex - 1); > + else > + relids = NULL; > + > + /* > + * Merge with any already-declared nulling rels. (Typically there won't > + * be any, but let's get it right if there are.) > + */ > + if (relids != NULL) > It seems the last if block can be merged into the previous if block. That > way `relids = NULL` can be omitted. No, because the list entry we fetch could be NULL. regards, tom lane