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

LEAD() and LAG() do not allow to specify 3rd argument ("DEFAULT" value when pointer is out of scope) of INT128 datatype. [CORE6357] #6598

Closed
firebird-issue-importer opened this issue Jul 6, 2020 · 5 comments

Comments

@firebird-issue-importer
Copy link

@firebird-issue-importer firebird-issue-importer commented Jul 6, 2020

Submitted by: @pavel-zotov

recreate table test1 (a smallint);
recreate table test2 (a bigint);
recreate table test3 (a int128);
recreate table test4 (a decfloat);

insert into test1 values (1);
insert into test1 values (2);

insert into test2 select * from test1;
insert into test3 select * from test1;
insert into test4 select * from test1;

set list on;
set sqlda_display on;

select a, lead(a, 1, 32767)over(order by a) lead_for_smallint from test1;
select a, lag(a, 1, -32768)over(order by a) lag_for_smallint from test1;

select a, lead(a, 1, 9223372036854775807)over(order by a) lead_for_bigint from test2;
select a, lag(a, 1, -9223372036854775808)over(order by a) lag_for_bigint from test2;

select a, lead(a, 1, 170141183460469231731687303715884105727)over(order by a) lead_for_int128 from test3;
select a, lag(a, 1, -170141183460469231731687303715884105728)over(order by a) lag_for_int128 from test3;

select a, lag(a, 1, -9.999999999999999999999999999999999e6144) over (order by a) lag_for_decfloat_1 from test4;
select a, lag(a, 1, -1.0e-6143)over(order by a) lag_for_decfloat_2 from test4;
select a, lag(a, 1, 1.0e-6143)over(order by a) lag_for_decfloat_3 from test4;
select a, lag(a, 1, 9.999999999999999999999999999999999e6144)over(order by a) lag_for_decfloat_4 from test4;

Result of LEAD() and LAG() for INT128 is:

Statement failed, SQLSTATE = 22000
Decimal float invalid operation. An indeterminant error occurred during an operation.

All other work OK.

Commits: fd9600f

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 6, 2020

Modified by: @pavel-zotov

Component: Engine [ 10000 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 7, 2020

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 8, 2020

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 RC 1 [ 10930 ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 9, 2020

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jul 9, 2020

Modified by: @pavel-zotov

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants