From: Sean C. <se...@ch...> - 2002-05-11 18:33:06
|
[moving discussion to rub...@li..., reply there] > On Fri, 2002-05-10 at 14:44, Brad Hilton wrote: > > usr/local/lib/ruby/site_ruby/1.6/DBD/Mysql/Mysql.rb:321:in `finish': > > undefined method `free' for #<Mysql:0x81a9d44> (NameError) > > from /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:701:in > > `finish' > > Well, to follow up to myself: > > It turns out the error is expected. Mysql objects don't have the > methods 'free' and 'fetch_fields' defined. Those methods are > actually in the class MysqlRes, which I found out after looking at > the c code. > > 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. > 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. Could you ellaborate? -sc -- Sean Chittenden |