Re: Making Vars outer-join aware - Mailing list pgsql-hackers

From Zhihong Yu
Subject Re: Making Vars outer-join aware
Date
Msg-id CALNJ-vQ_0iHqCsD8MAwBAJKj-O4KVe1jf0d_hWZcDrTsHWOf3Q@mail.gmail.com
Whole thread Raw
In response to Re: Making Vars outer-join aware  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Making Vars outer-join aware
List pgsql-hackers


On Mon, Aug 1, 2022 at 12:51 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Here's a rebase up to HEAD, mostly to placate the cfbot.
I accounted for d8e34fa7a (s/all_baserels/all_query_rels/
in those places) and made one tiny bug-fix change.
Nothing substantive as yet.

                        regards, tom lane

Hi,
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.

Cheers 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Making Vars outer-join aware
Next
From: Jacob Champion
Date:
Subject: Re: Strange behavior with polygon and NaN