[MDEV-6629] MIN/MAX and "HAVING func(DISTINCT)": wrong results Created: 2014-08-22 Updated: 2022-11-08 Resolved: 2022-11-08 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.0.13 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Federico Razzoli | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I know that this bug has been fixed by Oracle: But their solution (as it is documented in the bug page) is funny. I'm opening this to ask you if you could please apply a better fix. While the test case looks exotic, I realized that this causes bugs in an application when I use something like this: SELECT col1, MIN(col2), MAX(col2) Both MIN and MAX give completely wrong results, which makes the report useless. The only workaround I was able to find is slow. |
| Comments |
| Comment by Sergei Petrunia [ 2015-02-24 ] | ||||
|
( Checked the source code: we have Mithun's fix, merged). | ||||
| Comment by Sergei Golubchik [ 2022-11-08 ] | ||||
|
The second query
appears to work correctly |