Hello, All!
/**
* Firebird 2.1
* Ubuntu Linux 8.04.2
* Kernel and CPU: Linux 2.6.24-23-server on x86_64
*
* ðÒÏÝÅ ÎÅ ÐÏÌÕÞÉÌÏÓØ ×ÏÓÐÒÏÉÚ×ÅÓÔÉ ÂÁÇ, ÎÕÖÎÁ ÔÁÂÌÉÃÁ É ÐÒÏÃÅÄÕÒÁ
*/
CREATE TABLE TEST_BUG (
N BIGINT,
VAL DOUBLE PRECISION
);
INSERT INTO TEST_BUG (N, VAL) VALUES (1, 5);
COMMIT WORK;
SET TERM ^ ;
create or alter procedure TEST_BUG_PROC (
N bigint)
returns (
VAL double precision)
as
begin
select first 1 val
from test_bug
where n = :n
order by val asc
into :val;
suspend;
end^
SET TERM ; ^
GRANT SELECT ON TEST_BUG TO PROCEDURE TEST_BUG_PROC;
/*
ÓÏÂÓÔ×ÅÎÎÏ ÚÁÐÒÏÓ
ÐÒÉ ÐÏ×ÔÏÒÎÏÍ ÚÁÐÕÓËÅ (×ÉÄÉÍÏ, ÏÛÉÂËÁ × ËÅÛÉÒÏ×ÁÎÉÉ)
ÎÁ ÆÅÔÞÅ ×ÙÚÙ×ÁÅÔ ÏÛÉÂËÕ
'arithmetic exception, numeric overflow, or string truncation.'
*/
select RAW.* from(
select
maxvalue(
(select val from test_bug_proc(A)),
(select val from test_bug_proc(B))
) as C
from(
select cast(1 as BIGINT) as A, cast(1 as BIGINT) as B from rdb$database
union all
select NULL as A, cast(1 as BIGINT) as B from rdb$database
) as BASE
) as RAW
With best regards, Oleg Prosvetov.