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-automations opened this issue Jul 6, 2020 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

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-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

Component: Engine [ 10000 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

assignee: Alexander Peshkov [ alexpeshkoff ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @AlexPeshkoff

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

resolution: Fixed [ 1 ]

Fix Version: 4.0 RC 1 [ 10930 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

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

QA Status: No test => Done successfully

@firebird-automations
Copy link
Collaborator Author

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
Development

No branches or pull requests

2 participants