[MDEV-17242] Wrong result from distinct and arithmetic expression using window function Created: 2018-09-19 Updated: 2019-05-04 Resolved: 2019-05-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - Window functions |
| Affects Version/s: | 10.3.8, 10.2, 10.3, 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Lukas Eder | Assignee: | Varun Gupta (Inactive) |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Description: How to repeat:
produces wrong output:
Remove the DISTINCT keyword....
to get this:
As can be seen, the DISTINCT keyword should have no effect on this query. This is also described in this stack overflow question: The same bug appears also in MySQL: |
| Comments |
| Comment by Alice Sherepa [ 2018-09-20 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the report! Reproducible on MariaDB 10.2,10.3
As a temporary workaround, it is possible to use derived table or CTE table
| ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Varun Gupta (Inactive) [ 2019-04-11 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Looks like a duplicate for | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Varun Gupta (Inactive) [ 2019-05-04 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
After fix for
So closing this as a duplicate of |