views:

191

answers:

2

I have a client application that connects to the MySQL database 4 server using stock libraries on SuSE SLES 9. However, at times when processing a particular reset set from the server, iterating throw the results does not allow me to process all the results that is in the database.

This issue happens sometimes, mostly when servers have had several days of uptime. I would suspect that a reboot solves the problem.

Is there anyway that not releasing the MySQL result set over time gives rise to this memory leak and displays itself in this strange behavior must all result sets always be freed? However same table and same program behaves as should on another computer.

Could corruption of the result set occur because of implementation issues in either the application or the mysql client library?

A: 

You may think about upgrading to MySQL 5.
It's usually good to have the latest version.

Denes Tarjan
Upgrading to MySQL is not an option as i would have loved to do this personally.
Lochner Arendse
+1  A: 

Anything is possible, however I'd be inclined to go with app-level issues by default. Any problem that smells like it could be memory related is a prime candidate for a heap corruption bug if you're coding in C/C++, and that could cause result set problems. Also, I'm curious about how long you're holding this result set open for -- is it possible that the rows that you're "missing" might have been inserted between the time the query ran and when you're retrieving the value from the result set?

Finally, releasing a result set on the server happens automatically when you close the database connection, so unless you're holding a single connection open for days, that is unlikely to be the problem, absent a bug in MySQL.

womble