From: Brad H. <bh...@vp...> - 2002-05-11 22:45:19
|
On Sat, 2002-05-11 at 11:33, Sean Chittenden wrote: > > The problem is that ruby-dbd-mysql assumes that Mysql#query always > > MysqlRes objects, when that isn't true. If query_with_result is > > false, Mysql#query returns self (a Mysql object). > > Hmmm.... alright. What's the value of query_with_result being false? > Is it's point to save on the number of objects created? I don't see > any direct benefit of toggling this option. I don't know what the benefit of toggling query_with_result is either. I never directly manipulate the Mysql object, since I always use ruby-dbi as a higher level access point. I don't know what could possibly be setting query_with_result to false, but by the mere fact that it can happen, and thus break ruby-dbd-mysql, it seems that something needs to be fixed. > > > Could the maintainer of ruby-dbd-mysql look into this please? > > Basically, every time a @res_handle is grabbed from Mysql#query > > there is a false assumption that it is a MysqlRes object, and not a > > reference to the original Mysql object. > > I think it might be a fair assumption, but I'm neither the dbd_mysql > maintainer, nor am I familair with what that option does. Unfortunately, neither do I. I just stumbled on the problem and thought I'd report the invalid assumption that dbd-mysql is making about Mysql#query. Perhaps the code could be fixed by adding an addition check. Right now the could looks like: @res_handle.free if @res_handle Perhaps that needs to be changed to: @res_handle.free if (@res_handle and @res_handle.is_a? MysqlRes) I don't know... -Brad |