BUG #17614: "variable not found in subplan target lists" on grouping query

Lists: Postg젠 토토SQL : Postg젠 토토SQL 메일 링리스트 : 2022-09-15 이후 PGSQL 버그 12:35
From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: androiddown_weiwei(at)hotmail(dot)com
Subject: BUG #17614: "variable not found in subplan target lists" on grouping query
Date: 2022-09-15 12:35:33
Message-ID: 17614-8ec20c85bdecaa2a@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg젠 토토SQL : Postg젠 토토SQL 메일 링리스트 : 2022-09-15 이후 PGSQL 버그 12:35

The following bug has been logged on the website:

Bug reference: 17614
Logged by: Wei Wei
Email address: androiddown_weiwei(at)hotmail(dot)com
PostgreSQL version: 11.17
Operating system: Linux ubuntu 5.4.0-125-generic
Description:

The problem is reproducible with following sql:
```
SELECT
sp2.spf_id
FROM
information_schema.sql_parts AS sp
CROSS JOIN LATERAL ( SELECT sizing_id FROM information_schema.sql_sizing )
AS ss
CROSS JOIN LATERAL ( SELECT sp.feature_id AS spf_id ) AS sp2
GROUP BY
CUBE ( sp2.spf_id )
```
but seems having been fixed since 12.0


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: androiddown_weiwei(at)hotmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17614: "variable not found in subplan target lists" on grouping query
Date: 2022-09-15 19:23:30
Message-ID: 3419783.1663269810@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg무지개 토토SQL : Postg무지개 토토SQL 메일 링리스트 : 2022-09-15 이후 PGSQL-BUGS 19:23

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> The problem is reproducible with following sql:
> ```
> SELECT
> sp2.spf_id
> FROM
> information_schema.sql_parts AS sp
> CROSS JOIN LATERAL ( SELECT sizing_id FROM information_schema.sql_sizing )
> AS ss
> CROSS JOIN LATERAL ( SELECT sp.feature_id AS spf_id ) AS sp2
> GROUP BY
> CUBE ( sp2.spf_id )
> ```
> but seems having been fixed since 12.0

Yeah, it's a bug in code that we actually removed in v12
(so the fix was kind of accidental). Repaired, thanks
for the report!

regards, tom lane