Re: ERROR: wrong varnullingrels (b 3) (expected (b)) for Var 2/1

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Markus Winand <markus(dot)winand(at)winand(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: ERROR: wrong varnullingrels (b 3) (expected (b)) for Var 2/1
Date: 2023-06-12 02:44:00
Message-ID: CAMbWs48qRX9P=YybwaXEWgX+ZR-SU_PLMUHRKRA4Y9pLewYtbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Jun 10, 2023 at 12:08 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> > We can identify in which form of identity 3 the plan is built up by
> > checking the relids of the B/C join's outer rel. If it's in the first
> > form, the outer rel's relids must contain the A/B join. Otherwise it
> > should only contain B's relid. So I'm considering that maybe we can
> > adjust the nulling bitmap for nestloop parameters according to that.
> > Attached is a patch for that. Does this make sense?
>
> Hmm. I don't really want to do it in identify_current_nestloop_params
> because that gets applied to all nestloop params, so it seems like
> that risks masking bugs of other kinds. I'd rather do it in
> process_subquery_nestloop_params, which we know is only applied to
> subquery LATERAL references. So more or less as attached.

Yeah, that makes sense. process_subquery_nestloop_params is a better
place to do this adjustments. +1 to v2 patch.

Thanks
Richard

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2023-06-12 03:24:24 Re: Wrong results from Parallel Hash Full Join
Previous Message James Coleman 2023-06-12 02:23:45 Re: Parallelize correlated subqueries that execute within each worker