Bug #113415 Unknown column, but can get query result in CTE.
Submitted: 14 Dec 2023 6:27 Modified: 14 Dec 2023 8:49
Reporter: Shawn Yan (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:8.0, 8.0.35 OS:Any
Assigned to: CPU Architecture:Any

[14 Dec 2023 6:27] Shawn Yan
Description:
when I send CTE query to server, can get results with unknown column.

How to repeat:
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.32    |
+-----------+
1 row in set (0.00 sec)

mysql> WITH  cte1 AS (select 1), cte2 AS (SELECT a.*, t.id FROM cte1 a) SELECT 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.00 sec)

Suggested fix:
should be return query results, like, 
Unknown column 't.id' in 'field list'
[14 Dec 2023 8:49] MySQL Verification Team
Hello Shawn Yan,

Thank you for the report and feedback.

regards,
Umesh