Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not correct result function LAG, if OFFSET value ​​are assigned from a table [CORE4330] #4653

Closed
firebird-issue-importer opened this issue Feb 2, 2014 · 7 comments

Comments

@firebird-issue-importer
Copy link

firebird-issue-importer commented Feb 2, 2014

Submitted by: @sim1984

Is related to QA590

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

Commits: 49fa42f FirebirdSQL/fbt-repository@1f36b5e

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Feb 2, 2014

Modified by: @sim1984

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

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Feb 2, 2014

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Feb 3, 2014

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 3.0 Beta 1 [ 10332 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Mar 29, 2014

Modified by: @pcisar

Link: This issue is related to QA590 [ QA590 ]

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented May 28, 2015

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: Done successfully

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 23, 2015

Commented by: @pcisar

Test created.

@firebird-issue-importer
Copy link
Author

firebird-issue-importer commented Sep 23, 2015

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants