Ah, I had forgotten. Thanks. Tim.
On Tue, Dec 13, 2005 at 05:24:23PM -0000, Martin J. Evans wrote: > I took a look myself at selectrow_array but it seemed to be wrapped in > arrayref > and I wasn't exactly sure which bit to change without breaking arrayref. > Wondered if you "might" have forgotten about issue below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On Tue, 06 Dec 2005 15:32:11 -0000 (GMT), Tim Bunce wrote: > > Looks like a bug. The C version of selectrow_array is using > XSRETURN_UNDEF which will return an undef not an empty list. > Patch to follow, hopefully today. > > Thanks! > > Tim. > > On Tue, Dec 06, 2005 at 11:41:18AM -0000, Martin J. Evans wrote: > > The documentation for selecrow_array in DBI 1.49 says: > > > > "If any method fails, and "RaiseError" is not set, selectrow_array will > > return > > an empty list." > > > > use DBI; > > use strict; > > use Data::Dumper; > > my $dbh = DBI->connect('dbi:mysql:xxx','yyy','zzz'); > > $dbh->{RaiseError} = 0; > > $dbh->{PrintError} = 0; > > my @r = $dbh->selectrow_array('select xxx from yyy'); > > print "rows = ", $#r, "\n"; > > print "err = ", $dbh->err, "\n"; > > print "errstr = ", $dbh->errstr, "\n"; > > print Dumper(@r); > > > > and column xxx and table yyy does not exist I get: > > > > rows = 0 > > err = 1146 > > errstr = Table 'yyy' doesn't exist > > $VAR1 = undef; > > > > when I expected -1 for rows - as in: > > > > perl -e 'my @a=(); print $#a;' outputs -1 for an empty list, not 0 for a > > list > > containing an undef. > > > > It does not seem to matter what the driver is - I tried dbi::ODBC too. > > On 13-Dec-2005 Tim Bunce wrote: > > http://dbi.demonweb.co.uk/public/DBI-1.50.tar.gz > > > > > > =head2 Changes in DBI 1.50 (svn rev 2307), 13 December 2005 > > > > Fixed Makefile.PL options for gcc bug introduced in 1.49. > > Fixed handle magic order to keep DBD::Oracle happy. > > > > Changed dbi_profile_merge() to be able to recurse and merge > > sub-trees of profile data. > > > > Added documentation for dbi_profile_merge(), including how to > > measure the time spent inside the DBI for an http request. > > > > =head2 Changes in DBI 1.49 (svn rev 2287), 29th November 2005 > > > > Fixed assorted attribute handling bugs in DBD::Proxy. > > Fixed croak() in DBD::NullP thanks to Sergey Skvortsov. > > Fixed handling of take_imp_data() and dbi_imp_data attribute. > > Fixed bugs in DBD::DBM thanks to Jeff Zucker. > > Fixed bug in DBI::ProfileDumper thanks to Sam Tregar. > > Fixed ping in DBD::Proxy thanks to George Campbell. > > Fixed dangling ref in $sth after parent $dbh destroyed > > with thanks to [EMAIL PROTECTED] for the bug report #13151 > > Fixed prerequisites to include Storable thanks to Michael Schwern. > > Fixed take_imp_data to be more practical. > > > > Change to require perl 5.6.1 (as advertised in 2003) not 5.6.0. > > Changed internals to be more strictly coded thanks to Andy Lester. > > Changed warning about multiple copies of Driver.xst found in @INC > > to ignore duplicated directories thanks to Ed Avis. > > Changed Driver.xst to enable drivers to define an dbd_st_prepare_sv > > function where the statement parameter is an SV. That enables > > compiled drivers to support SQL strings that are UTF-8. > > Changed "use DBI" to only set $DBI::connect_via if not already set. > > Changed docs to clarify pre-method clearing of err values. > > > > Added ability for DBI::ProfileData to edit profile path on loading. > > This enables aggregation of different SQL statements into the same > > profile node - very handy when not using placeholders or when working > > multiple separate tables for the same thing (ie logtable_2005_11_28) > > Added $sth->{ParamTypes} specification thanks to Dean Arnold. > > Added $h->{Callbacks} attribute to enable code hooks to be invoked > > when certain methods are called. For example: > > $dbh->{Callbacks}->{prepare} = sub { ... }; > > With thanks to David Wheeler for the kick start. > > Added $h->{ChildHandles} (using weakrefs) thanks to Sam Tregar > > I've recoded it in C so there's no significant performance impact. > > Added $h->{Type} docs (returns 'dr', 'db', or 'st') > > Adding trace message in DESTROY if InactiveDestroy enabled. > > > > Ported DBI::ProfileDumper::Apache to mod_perl2 RC5+ > > thanks to Philip M. Golluci > > > > =cut > > > > Usual story... any and all testing most welcome. > > > > Thanks you! > > > > Tim.