Bug #72174 | UNION with set function in ORDER BY clause should be rejected | ||
---|---|---|---|
Submitted: | 31 Mar 2014 19:58 | Modified: | 4 Jun 2014 16:46 |
Reporter: | Roy Lyseng | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 5.1 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | order by, set function, UNION |
[31 Mar 2014 19:58]
Roy Lyseng
[31 Mar 2014 20:05]
Roy Lyseng
The result of SELECT 2 AS foo UNION SELECT 1 ORDER BY MAX(1); should be +-----+ | foo | +-----+ | 2 | +-----+
[2 Apr 2014 10:49]
MySQL Verification Team
Hello Roy, Thank you for the bug report and test case. Verified as described. Thanks, Umesh
[4 Jun 2014 16:46]
Paul DuBois
Noted in 5.7.5 changelog. UNION queries with an aggregate function in an ORDER BY clause were not rejected as they should be. Now such queries are rejected with an ER_AGGREGATE_ORDER_FOR_UNION error. Example: SELECT 1 AS foo UNION SELECT 2 ORDER BY MAX(1);