Re: Making Vars outer-join aware

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Richard Guo <guofenglinux(at)gmail(dot)com>, "Finnerty, Jim" <jfinnert(at)amazon(dot)com>
Subject: Re: Making Vars outer-join aware
Date: 2022-08-01 20:26:30
Message-ID: 2070642.1659385590@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Zhihong Yu <zyu(at)yugabyte(dot)com> 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhihong Yu 2022-08-01 20:28:37 Re: Making Vars outer-join aware
Previous Message Jacob Champion 2022-08-01 20:24:08 Re: A problem about partitionwise join