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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
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-13 03:34:39
Message-ID: 1452533.1686627279@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> Oh, wait ... It occurred to me that we may have this same issue with
> Memoize cache keys. In get_memoize_path we collect the cache keys from
> innerpath's ppi_clauses and innerrel's lateral_vars, and the latter may
> contain nullingrel markers that need adjustment. As an example,
> consider the query below

> explain (costs off)
> select * from onek t1
> left join onek t2 on true
> left join lateral
> (select * from onek t3 where t3.two = t2.two offset 0) s
> on t2.unique1 = 1;
> ERROR: wrong varnullingrels (b 3) (expected (b)) for Var 2/3

Good catch --- I'll take a closer look tomorrow.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2023-06-13 03:54:19 Re: pg_stat_io for the startup process
Previous Message Richard Guo 2023-06-13 03:33:00 Re: ERROR: wrong varnullingrels (b 3) (expected (b)) for Var 2/1