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

                 Key: CORE-6357
                 URL: http://tracker.firebirdsql.org/browse/CORE-6357
             Project: Firebird Core
          Issue Type: Bug
            Reporter: 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.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to