Issue Details (XML | Word | Printable)

Key: CORE-1370
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Viner Mihail
Votes: 0
Watchers: 1

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

Memory leak when using CTE within procedure

Created: 20/Jul/07 12:20 AM   Updated: 19/Jan/16 05:06 AM
Component/s: None
Affects Version/s: 2.1 Beta 1
Fix Version/s: 2.1 Beta 2

Environment: WinXP

QA Status: No test

 Description  « Hide
1) Create new database
2) Create table and procedure with CTE:

create table t ( id int, parent int )
insert into t (id,parent) values (0,0)
insert into t (id,parent) values (1,0)
insert into t (id,parent) values (2,0)
insert into t (id,parent) values (3,1)

create procedure p ( parent integer)
returns ( id integer)
  for with recursive children as (
    select id, parent from t where id=:parent
    union all
    select, t.parent from t join children c on and<>
  ) select id from children into id do suspend;

3) Run a query:

execute block
declare i integer = 0;
declare id integer;
  while (i<200000) do begin
    for select id from p(0) into id do begin end
    i = i + 1;

9 Mb of memory is allocated. It is not released after commit or rollback. Only released when disconnected.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.