Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
This task will cover the following phases of window functions processing:
Parsing
Name resolution and other semantic analysis
Optimization and building all data structures needed for execution.
Attachments
Issue Links
- blocks
-
MDEV-6115 window functions as in the SQL standard
-
- Closed
-
Activity
Summary | Parsing, semantic analysis and optimization for window functions. | Parsing, name resolution and optimization for window functions. |
Component/s | Optimizer - Window functions [ 13502 ] |
Fix Version/s | 10.2.1 [ 22012 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 73923 ] | MariaDB v4 [ 132783 ] |
Name resolution doesn't currently work when window functions are used with group by. Here is an example:
create table t1 (
username varchar(32),
amount int
);
insert into t1 values
('user1',1),
('user1',5),
('user1',3),
('user2',10),
('user2',20),
('user2',30);
select
username,
sum(amount),
rank() over (order by sum(amount) desc)
from t1
group by username;
The query is valid, but I get this error:
ERROR 1111 (HY000): Invalid use of group function