Bug #5814 | Sub-Select with Group by would return a wrong result | ||
---|---|---|---|
Submitted: | 29 Sep 2004 21:52 | Modified: | 4 Oct 2004 13:26 |
Reporter: | Dorn Bhechsonggram | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.1.5-gamma-standard | OS: | Linux (Fedora Core 1) |
Assigned to: | Oleksandr Byelkin | CPU Architecture: | Any |
[29 Sep 2004 21:52]
Dorn Bhechsonggram
[1 Oct 2004 12:34]
MySQL Verification Team
I can't repeat it on the latest 4.1.6-debug-log, but I was able reproduce it on latest 5.0 on Windows and Linux boxes. Table types: MyISAM, InnoDB.
[2 Oct 2004 17:53]
Dorn Bhechsonggram
In addition, if I issues the query statement: select c11,c12 from table1 group by 1; I would get the following error in informix: 294: The column (c12) must be in the GROUP BY list. However, mysql does not detect the error in group by list; however, it automatically does the group by for the rest of the columns. I am not sure whether this one is also a bug; or, mysql intends to perform that. FYI
[4 Oct 2004 13:26]
MySQL Verification Team
Fixed. Regarding your last comment, this is not a bug. According MySQL documentation: "MySQL extends the use of GROUP BY to allow you to select fields that are not mentioned in the GROUP BY clause." http://dev.mysql.com/doc/mysql/en/SELECT.html