[redland-dev] Free MySQL Connections

Dave Beckett Dave.Beckett at bristol.ac.uk
Sat Feb 12 23:45:28 GMT 2005


On Mon, 2005-01-24 at 10:20 +0000, Dave Beckett wrote: 
> On Mon, 10 Jan 2005 19:54:16 +0200, Simon Cross <simon at sanbi.ac.za> wrote:
> 
> > Greetings,
> > 
> > I'm using the Redland PHP bindings.  If I perform a query but stop
> > iterating through the results before they've been exhausted then MySQL
> > connections are left hanging until the process exits.  If I iterate all
> > the way through the results then the connections get closed.
> > 
> > I'd like to have the temporary connections associated with the query be
> > closed once the result and query have been freed (even if the full
> > results weren't used).
> > 
> > Any idea how I could achieve this?
> 
> It should be freeing the connections when you free the result and query;
> it's all streaming and should handle partial results.  I'll see if I
> can work out where this is happening.

I think I've found and fixed this bug.  In the query engine, it failed
to properly terminate and tidy up if the all the query results aren't
read.   This is also part of the problem with the bug Christopher
Schmidt reported later on repeated queries, I'll reply to that shortly.

I've not checked it with Mysql + PHP but I'm hoping it does since I've
not got an easy setup to run that.

The patch itself is quite small so I've attached it below.

Dave

-------------- next part --------------
A non-text attachment was scrubbed...
Name: qr.patch
Type: text/x-patch
Size: 1122 bytes
Desc: not available
Url : http://lists.gnomehack.com/pipermail/redland-dev/attachments/20050212/4753ee85/qr.bin


More information about the redland-dev mailing list