[MDEV-32520] Query aliases accessible in subquery Created: 2023-10-19 Updated: 2023-10-27 Resolved: 2023-10-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Parser |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Lou Mazzucchelli | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | compat80 | ||
| Environment: |
AWS |
||
| Description |
|
This query works in MySQL, but will not run in MariaDB. Why?
Output from MariaDB:
|
| Comments |
| Comment by Sergei Golubchik [ 2023-10-27 ] |
|
I'd say that MariaDB is correct and MySQL contradicts its own manual. Quoting https://dev.mysql.com/doc/refman/8.0/en/problems-with-alias.html
and
So, only GROUP BY, ORDER BY, and HAVING clauses are valid places where you can use a column alias, not a WHERE clause of the subquery in the SELECT list. |