Bug #11871 Memory leak with mysql_use_result in embedded server
Submitted: 11 Jul 2005 20:44 Modified: 5 Aug 2005 22:41
Reporter: Dean Ellis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S2 (Serious)
Version:4.0 foward OS:
Assigned to: CPU Architecture:Any

[11 Jul 2005 20:44] Dean Ellis
Description:
libmysqld has a memory leak with mysql_use_result() (protocol-level apparently), causing client RAM allocation to grow while iterating over result set.

How to repeat:
Attaching test case to files section.

Suggested fix:
Protocol::net_store_data()  calls alloc_root() but not sure anything is calling free_root()
[27 Jul 2005 14:27] Alexey Botchkov
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

handling queries, embedded library aways collects datasets in memory.
So huge dataset just fills all the memory available then fails with
OUT_OF_RESOURCES error.
Maybe we solve this problem in 5.0 but until then i only can recommend
to try to work with smaller recordsets.
[5 Aug 2005 22:40] Mike Hillyer
Added a note to the refman for mysql_use_result.