[MDEV-24937] window functions over unbounded RANGE fails on not numeric type Created: 2021-02-22 Updated: 2022-02-12 Resolved: 2022-02-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Optimizer - Window functions |
| Affects Version/s: | 10.3.27 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Minor |
| Reporter: | Daniel Black | Assignee: | Vicențiu Ciorbaru |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
"Numeric datatype is required for RANGE-type frame" https://dbfiddle.uk/?rdbms=mariadb_10.3&fiddle=b5818fc67035bb95bf7ad49663f456b4 Works in MySQL-8.0.23 as if RANGE was replace with ROWS. |
| Comments |
| Comment by Vicențiu Ciorbaru [ 2021-07-07 ] | ||||||
|
This is a limitation of current RANGE implementation. It will be fixed when MDEV-9727 is also fixed. | ||||||
| Comment by Daniel Black [ 2022-02-11 ] | ||||||
|
While MDEV-9727 will fix this, as UNBOUNDED won't look at the type or the value, maybe this could still be done. | ||||||
| Comment by Vicențiu Ciorbaru [ 2022-02-11 ] | ||||||
|
I do not want to introduce a hack to only allow RANGE type frames, regardless of data type, if UNBOUNDED PRECEDING & UNBOUNDED FOLLOWING is present on the respective ends of the window frame. This would create queries like this that work:
and queries like this that do not work:
This would set confusing expectations for users and we'd also have a very peculiar documentation problem that needs to always be maintained as long as that version is supported. We should just get MDEV-9727 implemented instead, not waste time with hacks. | ||||||
| Comment by Daniel Black [ 2022-02-12 ] | ||||||
|
Ok. |