BUG #18305: Unexpected error: "WindowFunc not found in subplan target lists" triggered by subqueries

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: zuming(dot)jiang(at)inf(dot)ethz(dot)ch
Subject: BUG #18305: Unexpected error: "WindowFunc not found in subplan target lists" triggered by subqueries
Date: 2024-01-22 12:15:00
Message-ID: 18305-33c49b4c830b37b3@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 18305
Logged by: Zuming Jiang
Email address: zuming(dot)jiang(at)inf(dot)ethz(dot)ch
PostgreSQL version: 16.1
Operating system: Ubuntu 20.04
Description:

My fuzzer finds a bug in Postgres 17devel, which triggers an unexpected
error "ERROR: WindowFunc not found in subplan target lists".

--- Set up database ---
create table exeet_t3 (pkey int4);
create view exeet_t8 as
select
ntile(exeet_subq_0.c_0) over () as c_0
from
(select (select pkey from exeet_t3 order by pkey limit 1 offset 6) as
c_0) as exeet_subq_0;

The fuzzer generates a test case:

--- Test case ---
select
1 as c_1
from
exeet_t8 as exeet_ref_17
where exeet_ref_17.c_0 < 0;

--- Expected behavior ---
The test case should not trigger any error.

--- Actual behavior ---
The test case trigger an error:

ERROR: WindowFunc not found in subplan target lists

--- Postgres version ---
Github commit: b0f0a9432d0b6f53634a96715f2666f6d4ea25a1
Version: PostgreSQL 17devel on x86_64-pc-linux-gnu, compiled by gcc
(Ubuntu
9.4.0-1ubuntu1~20.04.2) 9.4.0, 64-bit

--- Platform information ---
Platform: Ubuntu 20.04
Kernel: Linux 5.4.0-147-generic

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fensterman, John P 2024-01-22 15:07:25 RE: [EXTERNAL] Re: BUG #18289: postgresql14-devel-14.10-2PGDG.rhel8.x86_64.rpm Contains invalid cLang option in Makefile.global
Previous Message David Rowley 2024-01-22 11:11:29 Re: Removing const-false IS NULL quals and redundant IS NOT NULL quals