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
Simonov Denis made changes - 02/Feb/14 06:50 PM
Field Original Value New Value
Summary not correct result function LAG, if the value OFFSET values ​​are assigned from a table not correct result function LAG, if OFFSET value ​​are assigned from a table
Adriano dos Santos Fernandes made changes - 02/Feb/14 08:11 PM
Assignee Adriano dos Santos Fernandes [ asfernandes ]
Adriano dos Santos Fernandes made changes - 03/Feb/14 04:27 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0 Beta 1 [ 10332 ]
Resolution Fixed [ 1 ]
Pavel Cisar made changes - 29/Mar/14 05:53 PM
Link This issue is related to QA-590 [ QA-590 ]
Pavel Zotov made changes - 28/May/15 02:49 PM
Status Resolved [ 5 ] Resolved [ 5 ]
QA Status Done successfully
Pavel Cisar made changes - 23/Sep/15 12:42 PM
Status Resolved [ 5 ] Closed [ 6 ]