From: Peter Rabbitson Date: Thu, 4 Jun 2009 20:54:28 +0000 (+0000) Subject: having without group_by is useless - thus do not supply a group_by on count, let... X-Git-Tag: v0.08106~37 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ebd3d91a73adefa4018398afa4da962c0a3eafa5;p=dbsrgits%2FDBIx-Class.git having without group_by is useless - thus do not supply a group_by on count, let things die --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index ab04d69..4ab4afa 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -1155,7 +1155,7 @@ sub count { return $self->search(@_)->count if @_ and defined $_[0]; return scalar @{ $self->get_cache } if $self->get_cache; - my $meth = $self->_has_attr (qw/prefetch collapse distinct group_by having/) + my $meth = $self->_has_attr (qw/prefetch collapse distinct group_by/) ? 'count_grouped' : 'count' ;