Re: BUG #18277: Unexpected error: "WindowFunc not found in subplan target lists" triggered by JOIN and Window Func

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, zuming(dot)jiang(at)inf(dot)ethz(dot)ch, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18277: Unexpected error: "WindowFunc not found in subplan target lists" triggered by JOIN and Window Func
Date: 2024-01-09 21:34:31
Message-ID: 2228854.1704836071@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> On Tue, Jan 9, 2024 at 7:00 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
>>> My fuzzer finds a bug in Postgres 17devel, which triggers an unexpected
>>> error "ERROR: WindowFunc not found in subplan target lists".

> I think this is caused by that query_tree_mutator fails to mutate
> runCondition for WindowClause.

Ugh! That seems quite horrid. David, was there a reason to not do
that, or was it just an oversight?

> I think we should also consider WindowClause->runCondition in
> query_tree_walker, expression_tree_mutator and expression_tree_walker.

Offhand, +1. If it has the form of an ordinary expression tree
then it really needs to be processed in all these places.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2024-01-09 21:44:47 Re: BUG #17257: (auto)vacuum hangs within lazy_scan_prune()
Previous Message Peter Geoghegan 2024-01-09 20:59:19 Re: BUG #17257: (auto)vacuum hangs within lazy_scan_prune()