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
-
Activity
Sprint | 10.2.0-9 [ 43 ] |
Rank | Ranked higher |
Status | Open [ 1 ] | In Progress [ 3 ] |
Sprint | 10.2.0-9 [ 43 ] | 10.2.0-9, 10.2.0-10 [ 43, 46 ] |
Sprint | 10.2.0-9, 10.2.0-10 [ 43, 46 ] | 10.2.0-9, 10.2.0-10, 10.2.0-11 [ 43, 46, 47 ] |
Component/s | Optimizer - Window functions [ 13502 ] | |
Component/s | Optimizer [ 10200 ] |
Fix Version/s | 10.2.1 [ 22012 ] | |
Fix Version/s | 10.2 [ 14601 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Resolution | Fixed [ 1 ] | |
Status | Closed [ 6 ] | Stalled [ 10000 ] |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 74639 ] | MariaDB v4 [ 132819 ] |
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.