[MDEV-20012] Window function multiplication on empty table on default value returns wrong result Created: 2019-07-10 Updated: 2020-06-19 Resolved: 2020-06-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer, Optimizer - Window functions |
| Affects Version/s: | 10.4.5, 10.4.6, 10.2, 10.3, 10.4 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | - | Assignee: | Varun Gupta (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | bug, wrong_result | ||
| Environment: |
Ubuntu 18.04 running MariaDB in Docker |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
The following code returns deterministically the wrong result:
MariaDB return '2', Postgres and MySQL 8.0.16 return '0', which is correct (COUNT should return 0). Therefore, I expect that MariaDB also returns 0. This bug required DEFAULT 1 and WHERE FALSE. If one removes one of both, the bug disappears. I tested versions 10.4.5 and 10.4.6, both versions are affected. In MySQL 8.0.16, the correct value is returned. |
| Comments |
| Comment by Alice Sherepa [ 2019-07-10 ] | ||||||||||||||||||||||||||||||||
|
Thank you for the report!
| ||||||||||||||||||||||||||||||||
| Comment by Varun Gupta (Inactive) [ 2020-06-19 ] | ||||||||||||||||||||||||||||||||
|
Fixed by | ||||||||||||||||||||||||||||||||
| Comment by Varun Gupta (Inactive) [ 2020-06-19 ] | ||||||||||||||||||||||||||||||||
|
I see these results now
|