Bug #72189 | SELECT with alias not working in 5.7 | ||
---|---|---|---|
Submitted: | 1 Apr 2014 15:41 | Modified: | 11 Jun 2014 16:21 |
Reporter: | Jan Rusch | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 5.7.4 | OS: | Any (MS Windows, Linux) |
Assigned to: | CPU Architecture: | Any | |
Tags: | regression |
[1 Apr 2014 15:41]
Jan Rusch
[1 Apr 2014 16:56]
Sveta Smirnova
Thank you for the report. Verified as described.
[2 Apr 2014 6:42]
Øystein Grøvlen
A work-around is to remove the ORDER BY in the subquery. ORDER BY in subqueries has anyway no guaranteed effect on the order of the final result.
[2 Apr 2014 8:38]
Jan Rusch
Thanks for the workaround, but leaving out the ORDER BY is not an option, if you have a running application and dont want to change a lot of statements.
[11 Jun 2014 16:21]
Paul DuBois
Noted in 5.7.5 changelog. A SELECT statement using a subquery with UNION and ORDER BY did not permit use of an alias in the outer statement.