Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
10.2.0-9, 10.2.0-10, 10.2.0-11
Description
Study (and fix) the interplay between window functions and other SQL constructs, like ORDER BY ... LIMIT, DISTINCT, etc.
Known things:
- LIMIT should be applied AFTER the window functions are computed (that is, window function computation should see rows that are cut off by LIMIT)
- DISTINCT must not be converted into GROUP BY when window functions are present
- need to check window functions inside derived table and/or union. Item_window_func::update_field() is not implemented, is this ok?
Attachments
Issue Links
- is part of
-
MDEV-6115 window functions as in the SQL standard
-
- Closed
-
Example from Peter:
create table t1 (s1 int, s2 char(5));
insert into t1 values (1,'a');
insert into t1 values (null,null);
insert into t1 values (1,null);
insert into t1 values (null,'a');
insert into t1 values (2,'b');
insert into t1 values (-1,'');
select *,
row_number() over (order by s1)
- row_number() over (order by s1) as X from t1;
This crashes, because "split_sum_func" process is not done correctly for window functions.