|
From: Brad H. <bh...@vp...> - 2002-05-13 18:36:00
|
On Sun, 2002-05-12 at 21:20, Sean Chittenden wrote:
> > 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...
>
> I'm a PostgreSQL guy myself. Could you test the above change and see
> if it works for you? You seem to have done the diagnosis correctly
> and I think it should work. -sc
Actually, I think a better solution than my previous one is to set
query_with_result = true in Mysql.rb line 313 in execute(). It is
obvious that the code expects query_with_result to be set to true in
that instance, and there are many places in the code that assume
@res_handle is a MysqlRes object, so I believe this would be the best
solution.
Attached is a sample script which exposes the problem, as well as a
patch to fix the bug.
Thanks,
-Brad
-- patch --
--- Mysql.rb.orig Mon May 13 11:32:33 2002
+++ Mysql.rb Mon May 13 09:48:52 2002
@@ -310,6 +310,7 @@ class Statement < DBI::BaseStatement
end
def execute
+ @handle.query_with_result = true
@res_handle = @handle.query(@prep_stmt.bind(@params))
@current_row = 0
@rows = @handle.affected_rows
|