Author: timbo
Date: Mon Mar 24 07:06:48 2008
New Revision: 10994

Modified:
   dbi/trunk/Changes
   dbi/trunk/DBI.pm
   dbi/trunk/t/10examp.t

Log:
Fixed fetchall_arrayref with $max_rows argument broken in 1.603
thanks to Greg Sabino Mullane (incl tests).
Prep for 1.604.


Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes   (original)
+++ dbi/trunk/Changes   Mon Mar 24 07:06:48 2008
@@ -40,6 +40,12 @@
 Call method on transport failure so transport can cleanup/reset if it wants
 Gofer: gearman - need to disable coallesing for non-idempotent requests
 
+=head2 Changes in DBI 1.604 (svn rev 10994) 24th March 2008
+
+  Fixed fetchall_arrayref with $max_rows argument broken in 1.603,
+    thanks to Greg Sabino Mullane.
+  Fixed a few harmless compiler warnings on cygwin.
+
 =head2 Changes in DBI 1.603
 
   Fixed pure-perl fetchall_arrayref with $max_rows argument

Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm    (original)
+++ dbi/trunk/DBI.pm    Mon Mar 24 07:06:48 2008
@@ -9,7 +9,7 @@
 require 5.006_00;
 
 BEGIN {
-$DBI::VERSION = "1.603"; # ==> ALSO update the version in the pod text below!
+$DBI::VERSION = "1.604"; # ==> ALSO update the version in the pod text below!
 }
 
 =head1 NAME
@@ -121,7 +121,7 @@
 
 =head2 NOTES
 
-This is the DBI specification that corresponds to the DBI version 1.603
+This is the DBI specification that corresponds to the DBI version 1.604
 ($Revision$).
 
 The DBI is evolving at a steady pace, so it's good to check that
@@ -1953,7 +1953,7 @@
         # when batch fetching with $max_rows were very likely to try to
         # fetch the 'next batch' after the previous batch returned
         # <=$max_rows. So don't treat that as an error.
-        return undef if $max_rows and not $sth->{Active};
+        return undef if $max_rows and not $sth->FETCH('Active');
 
        my $mode = ref($slice) || 'ARRAY';
        my @rows;

Modified: dbi/trunk/t/10examp.t
==============================================================================
--- dbi/trunk/t/10examp.t       (original)
+++ dbi/trunk/t/10examp.t       Mon Mar 24 07:06:48 2008
@@ -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 => 208;
 
 # "globals"
 my ($r, $dbh);
@@ -228,13 +228,18 @@
 ok(keys %{$r->[0]} == 3);
 ok("@{$r->[0]}{qw(MODE SIZE NAME)}" eq "@row_a", "'@{$r->[0]}{qw(MODE SIZE 
NAME)}' ne '@row_a'");
 
-# use Data::Dumper; warn Dumper([EMAIL PROTECTED], $r]);
-
+print "rows()\n"; # assumes previous fetch fetched all rows
 $rows = $csr_b->rows;
 ok($rows > 0, "row count $rows");
 ok($rows == @$r, "$rows vs "[EMAIL PROTECTED]);
 ok($rows == $DBI::rows, "$rows vs $DBI::rows");
 
+print "fetchall_arrayref array slice and max rows\n";
+ok($csr_b->execute());
+$r = $csr_b->fetchall_arrayref([0], 1);
+ok($r);
+is_deeply($r, [[$row_a[0]]]);
+
 # ---
 
 print "selectrow_array\n";

Reply via email to