1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-19052 Range-type window frame supports only numeric datatype

When there is no bounds on the upper or lower part of the window,
it doesn't matter if the type is numeric.

It also doesn't matter how many ORDER BY items there are in the
query.

Reviewers: Sergei Petrunia and Oleg Smirnov
This commit is contained in:
Daniel Black
2024-06-14 14:05:48 +10:00
parent 26f31bdd52
commit 7788593547
4 changed files with 151 additions and 20 deletions

View File

@ -262,9 +262,12 @@ setup_windows(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
For "win_func() OVER (ORDER BY order_list RANGE BETWEEN ...)",
- ORDER BY order_list must not be ommitted
- the list must have a single element.
But it really only matters if the frame is bounded.
*/
if (win_spec->window_frame &&
win_spec->window_frame->units == Window_frame::UNITS_RANGE)
win_spec->window_frame->units == Window_frame::UNITS_RANGE &&
!(win_spec->window_frame->top_bound->is_unbounded() &&
win_spec->window_frame->bottom_bound->is_unbounded()))
{
if (win_spec->order_list->elements != 1)
{