Bug #42322 | 5.1.30-community allows mixing of group and no group columns without group by | ||
---|---|---|---|
Submitted: | 24 Jan 2009 15:46 | Modified: | 24 Jan 2009 15:56 |
Reporter: | Paco Zarabozo | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.1.30 | OS: | Windows (SP3) |
Assigned to: | CPU Architecture: | Any | |
Tags: | GROUP BY, mixing of group columns with no group columns |
[24 Jan 2009 15:46]
Paco Zarabozo
[24 Jan 2009 15:56]
MySQL Verification Team
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional Info; Please use the sql_mode ONLY_FULL_GROUP_BY. Thanks in advance. http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html "ONLY_FULL_GROUP_BY Do not allow queries for which the SELECT list refers to non-aggregated columns that are not named in the GROUP BY clause. The following query is invalid with this mode enabled because address is not named in the GROUP BY clause: SELECT name, address, MAX(age) FROM t GROUP BY name; As of MySQL 5.1.11, this mode also restricts references to non-aggregated columns in the HAVING clause that are not named in the GROUP BY clause. "