Issue Details (XML | Word | Printable)

Key: CORE-2455
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Alexander Peshkov
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird Core

Server fails when doing DROP DATABASE right after error in statistical fnction

Created: 07/May/09 08:25 PM   Updated: 12/Nov/09 03:01 PM
Component/s: Engine
Affects Version/s: 2.5 Beta 1
Fix Version/s: 2.5 Beta 2

Environment: any

 Description  « Hide
AV happens in the end of execution of the following isql script:


-- this implementation of factorial is not recursive.

 set term ^;
 create procedure factorial (
 max_rows integer,
 mode integer )
 returns (row_num integer, result integer ) as
 declare variable temp integer;
 declare variable counter integer;
 while (counter <= max_rows) do begin
 row_num = counter;
 if (row_num=0) then
 temp=temp * row_num;
 counter = counter + 1;
 if (mode=1) then suspend;
 if (mode=2) then suspend;
 set term ; ^

select * from factorial (5,2);

create table onerow (i integer);
insert into onerow values (5);

-- note the derived table query
select (select ROW_NUM from factorial(i,2)) as RN from onerow ;
select (select RESULT from factorial(i,2)) as RS from onerow ;

-- note the derived table query
select (select ROW_NUM from factorial(i,1)) as RN from onerow ;
select (select RESULT from factorial(i,1)) as RS from onerow ;

drop database ;

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 07/May/09 08:53 PM
Without calls to RSE_close req_attachment in procedural request reamins set, and points to already deleted attachment when MET_clear_cache() is called during database shutdown. It is good idea to try to close rsb on error thrown during statistical function evaluation.