Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak when using CTE within procedure [CORE1370] #1788

Closed
firebird-automations opened this issue Jul 20, 2007 · 5 comments
Closed

Memory leak when using CTE within procedure [CORE1370] #1788

firebird-automations opened this issue Jul 20, 2007 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Viner Mihail (mviner)

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)
as
begin
for with recursive children as (
select id, parent from t where id=:parent
union all
select http://t.id, t.parent from t join children c on http://t.parent=c.id and http://t.id<>http://c.id
) select id from children into id do suspend;
end

3) Run a query:

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

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

Commits: 8ff8037

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

assignee: Vlad Horsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.1 Beta 2 [ 10190 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

Workflow: jira [ 12630 ] => Firebird [ 14224 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

QA Status: No test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants