You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: