Changed COUNT code in cursor to use selectrow_array (cheers dkubb)
Matt S Trout [Sun, 31 Jul 2005 23:22:26 +0000 (23:22 +0000)]
lib/DBIx/Class/Cursor.pm

index b28bf27..83baa7d 100644 (file)
@@ -32,9 +32,8 @@ sub count {
     my $class = $self->{class};
     my $sth = $class->_get_sth( 'select', [ 'COUNT(*)' ],
                                   $class->_table_name, $cond);
-    $sth->execute(@{$self->{args} || []});
-    my ($count) = $sth->fetchrow_array;
-    $sth->finish;
+    my ($count) = $class->_get_dbh->selectrow_array(
+                                      $sth, undef, @{$self->{args} || []});
     return $count;
   } else {
     return scalar $_[0]->all; # So inefficient