On Thu, Aug 02, 2007 at 04:26:02PM -0400, Philip Dye wrote: > DBD::Proxy version 0.2004 > > fetch() doesn't set proxy_rows. > > disconnect() shouldn't attempt to dereference rdbh if it isn't defined. > > Patches attached.
Thanks. I agree with the second (applied). For the first I suspect it's incomplete. fetch typically fetches batches of rows. It looks like your patch would make $sth->rows return the size of the most recent batch, typically 20. I may be overlooking something as I'm out of touch with the code. Let me know what you think. Tim. > Have a great day ! > > Philip Dye > Senior Research Systems Programmer > Computing Facilities Group > School of Computer Science > > *** DBD/Proxy.pm.orig Mon Jun 25 19:40:16 2007 > --- DBD/Proxy.pm Thu Aug 2 16:13:59 2007 > *************** sub fetch ($) { > *** 609,614 **** > --- 609,615 ---- > } > return undef unless @rows; > $sth->{'proxy_data'} = $data = [EMAIL PROTECTED]; > + $sth->{'proxy_rows'} = @rows; > } > my $row = shift @$data; > > *** DBD/Proxy.pm.orig Mon Jun 25 19:40:16 2007 > --- DBD/Proxy.pm Thu Aug 2 16:10:27 2007 > *************** sub disconnect ($) { > *** 306,315 **** > > # Drop database connection at remote end > my $rdbh = $dbh->{'proxy_dbh'}; > local $SIG{__DIE__} = 'DEFAULT'; > local $@; > ! eval { $rdbh->disconnect() }; > DBD::Proxy::proxy_set_err($dbh, $@) if $@; > > # Close TCP connect to remote > # XXX possibly best left till DESTROY? Add a config attribute to choose? > --- 306,317 ---- > > # Drop database connection at remote end > my $rdbh = $dbh->{'proxy_dbh'}; > + if ( defined($rdbh) ) { > local $SIG{__DIE__} = 'DEFAULT'; > local $@; > ! eval { $rdbh->disconnect() } ; > DBD::Proxy::proxy_set_err($dbh, $@) if $@; > + } > > # Close TCP connect to remote > # XXX possibly best left till DESTROY? Add a config attribute to choose?