Bug #10107 Memory leak in view over subquery
Submitted: 23 Apr 2005 2:53 Modified: 28 Apr 2005 17:29
Reporter: Sergey Petrunia
Status: Closed
Category:Server Severity:S3 (Non-critical)
Version:5.0-bk OS:
Assigned to: Sergey Petrunia Target Version:

[23 Apr 2005 2:53] Sergey Petrunia
Description:
Selecting from a view that contains subquery causes memory leaks.

How to repeat:
Run this test
----
create table t1 as select 1 A union select 2 union select 3;
create table t2 as select * from t1;
create table t3 as select a a,a b from t2;
create view v2 as select * from t3 where 
  a in (select * from t1) or b in (select * from t2);

select * from v2 A where A.a  < 2;

drop view v2;
drop table t1, t2, t3;
----
And get this:

Warning: Not freed memory segments: 1
Warning: Memory that was not free'ed (880 bytes):
           880 bytes at 0x008cd3c20, allocated at line 3111 in 'sql_select.cc'

Suggested fix:
Figure out where the JOIN::cleanup call is missing
[23 Apr 2005 2:54] Sergey Petrunia
Can't push fix for BUG#8490 because of this, so I'm assigning this to myself
[23 Apr 2005 4:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24242
[25 Apr 2005 2:23] Sergey Petrunia
Pushed into 5.0.5 tree
[28 Apr 2005 17:29] Paul DuBois
Noted in 5.0.5 changelog.