-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

I noticed a failing test when using DBI 1.603 on DBD::Pg and
tracked the error back to this new line inside of pure-perl
fetchall_arrayref in DBI.pm:

return undef if $max_rows and not $sth->{Active};

As far as I can tell, $sth at this point is the *driver's* statement
handle, and not DBI::st, and thus is not tied, so the value
always returns false (undef), regardless of whether or not the
statement is active or not. I could not find an easy way to get to
the DBI::st information. Here's a patch to the test suite that
demonstrates the problem:

Index: t/10examp.t
===================================================================
- --- t/10examp.t (revision 10980)
+++ t/10examp.t (working copy)
@@ -12,7 +12,7 @@
 my $haveFileSpec = eval { require File::Spec };
 require VMS::Filespec if $^O eq 'VMS';

- -use Test::More tests => 205;
+use Test::More tests => 207;

 # "globals"
 my ($r, $dbh);
@@ -221,6 +221,11 @@
 ok($r->[0]->{SizE} == $row_a[1]);
 ok($r->[0]->{nAMe} eq $row_a[2]);

+print "fetchall_arrayref array slice and max rows\n";
+ok($csr_b->execute());
+$r = $csr_b->fetchall_arrayref([0], 1);
+is_deeply($r, [[$row_a[0]]]);
+
 print "fetchall_arrayref hash\n";
 ok($csr_b->execute());
 $r = $csr_b->fetchall_arrayref({});




- --
Greg Sabino Mullane [EMAIL PROTECTED]
End Point Corporation
PGP Key: 0x14964AC8 200803231157
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAkfmff4ACgkQvJuQZxSWSsgvjACgvVpJyvJMBLJrprlf7TxyV5ri
aNkAn0WL6LPPtkCVb3bM5UIbq4z6x7qQ
=0z+3
-----END PGP SIGNATURE-----


Reply via email to