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
Operations

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

Time Tracking:
Not Specified

Environment: any

Planning Status: Unspecified


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

SET NAMES ASCII;
CREATE DATABASE 'test.fdb' DEFAULT CHARACTER SET ISO8859_1;

-- 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;
 begin
 counter=0;
 temp=1;
 while (counter <= max_rows) do begin
 row_num = counter;
 if (row_num=0) then
 temp=1;
 else
 temp=temp * row_num;
 result=temp;
 counter = counter + 1;
 if (mode=1) then suspend;
 end
 if (mode=2) then suspend;
 end
 ^
 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   Work Log   Change History   Version Control   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.