Bug #116971 | CTE With clause bug | ||
---|---|---|---|
Submitted: | 13 Dec 2024 12:03 | Modified: | 16 Dec 2024 7:24 |
Reporter: | Sagar Vyas | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Parser | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[13 Dec 2024 12:03]
Sagar Vyas
[13 Dec 2024 12:30]
Sagar Vyas
queryI have provided is working that is the bug. My t1_temp CTE does not have a column "id" in the select list and still I am able to do a select on that column. Even If I do a select on a column which is unique to the table and not in the CTE, the query still works.
[13 Dec 2024 14:15]
Sagar Vyas
Even if I don't use CTE, select * from T1 where fullName in (select fullName from T2); this is strange because there's no column "fullname" in T2. I have tried other sql servers where it fails.
[13 Dec 2024 14:31]
MySQL Verification Team
Hi Mr. Vyas, That is incredible, but this is very much true. This goes against every SQL standard. This is a minor bug, but still truly a bug ....... Verified as S3 bug for all currently supported versions from 8.0 to 9.1. Thank you for your contribution.
[16 Dec 2024 7:24]
Roy Lyseng
Posted by developer: This is not a bug. In the subquery, the column "id" is available as an outer reference from the outer query on the CTE T2_temp. You can make it explicit by substituting "id" with "s.id" in the subquery.
[16 Dec 2024 10:43]
MySQL Verification Team
Thank you, Roy.