From: Matt S Trout Date: Sun, 31 Jul 2005 23:22:26 +0000 (+0000) Subject: Changed COUNT code in cursor to use selectrow_array (cheers dkubb) X-Git-Tag: v0.03001~114 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2840de8fbf8506d2edbec5a9c7500136f0fc1c2a;p=dbsrgits%2FDBIx-Class.git Changed COUNT code in cursor to use selectrow_array (cheers dkubb) --- diff --git a/lib/DBIx/Class/Cursor.pm b/lib/DBIx/Class/Cursor.pm index b28bf27..83baa7d 100644 --- a/lib/DBIx/Class/Cursor.pm +++ b/lib/DBIx/Class/Cursor.pm @@ -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