[MDEV-9923] ORDER BY position in window function causes strange error code Created: 2016-04-14  Updated: 2017-02-03  Resolved: 2017-02-03

Status: Closed
Project: MariaDB Server
Component/s: Optimizer - Window functions
Affects Version/s: 10.2
Fix Version/s: 10.2.4

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-9896 Testing for window functions Open

 Description   

create table t1 (i int);
select rank() over (order by 1) from t1;
ERROR 4007 (HY000): Window function is not allowed in window specification

The error is very confusing.



 Comments   
Comment by Igor Babaev [ 2017-02-03 ]

If we change the integer in order by for 2 we have another bogus error:

MariaDB [test]> select rank() over (order by 2) from t1;
ERROR 1054 (42S22): Unknown column '2' in 'order clause'

Comment by Igor Babaev [ 2017-02-03 ]

The fix for this bug was pushed into the 10.2 tree.

Generated at Thu Feb 08 07:38:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.