[MDEV-19017] incorrect LAST_VALUE() result Created: 2019-03-22 Updated: 2020-07-20 Resolved: 2020-07-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - Window functions |
| Affects Version/s: | 10.3.11, 10.2.19, 10.2, 10.3, 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Daniel Black | Assignee: | Varun Gupta (Inactive) |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
https://dba.stackexchange.com/questions/232814/last-value-in-two-levels-of-group-by-in-mysql https://dbfiddle.uk/?rdbms=mariadb_10.3&fiddle=803339c7ce6ae11967944c427b01ff8b
Results:
Expected Results
|
| Comments |
| Comment by Alice Sherepa [ 2019-03-25 ] | |||||||||||||||||||||||||||||
|
Thanks! Reproduced as described on 10.2-10.4
| |||||||||||||||||||||||||||||
| Comment by Varun Gupta (Inactive) [ 2020-07-16 ] | |||||||||||||||||||||||||||||
|
This is not a bug, GROUP BY clause is applied to the query before window function computation.
and so window function last_value and first value will be applied to this result
and this returns correct result. |