Issue Details (XML | Word | Printable)

Key: CORE-4330
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Simonov Denis
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

not correct result function LAG, if OFFSET value ​​are assigned from a table

Created: 02/Feb/14 05:31 PM   Updated: 23/Sep/15 12:42 PM
Component/s: None
Affects Version/s: 3.0 Alpha 2
Fix Version/s: 3.0 Beta 1

Issue Links:
Relate
 

QA Status: Done successfully


 Description  « Hide
with t(a, b) as
(
  select 1, null from rdb$database
  union all
  select 2, 1 from rdb$database
  union all
  select 3, 2 from rdb$database
  union all
  select 4, 3 from rdb$database
  union all
  select 5, 2 from rdb$database
)
select
  a,
  b,
  lag(a, b) over(order by a) as la
from t

A B LA
1
2 1 <-- incorrect
3 2 <-- incorrect
4 3 2 <-- incorrect
5 2 3

PostgreSQL return correct result

with t(a, b) as
(
  select 1, null
  union all
  select 2, 1
  union all
  select 3, 2
  union all
  select 4, 3
  union all
  select 5, 2
)
select
  a,
  b,
  lag(a, b) over(order by a) as la
from t

A B LA
1
2 1 1
3 2 1
4 3 1
5 2 3


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.