Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL)
Description
Our current implementation selects an ordering for rows implicitly. This can lead to results that look like this:
create table t1 (a int);
|
insert into t1 values (1), (2), (10), (0);
|
select a, lag(a, 1) over () from t1;
|
a lag(a, 1) over ()
|
1 0
|
2 1
|
10 2
|
0 NULL
|
The ordering used by lag is (ORDER BY a), but we don't return the rows in this order. Also, this would be quite confusing if multiple window functions are used.
Instead of running this query like this and produce confusing results, we should return an error of the form:
"No order list in window specification for 'LAG'"
|