From: Matt S Trout Date: Tue, 23 May 2006 21:23:01 +0000 (+0000) Subject: works. win. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0068f3eecc52a2a45fafc598d398ac864bd427ce;p=dbsrgits%2FDBIx-Class-Historic.git works. win. --- diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index f57c913..4a164d4 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -847,7 +847,7 @@ sub _count { # Separated out so pager can get the full count $self->_resolve; my $attrs = { %{ $self->{_attrs} } }; - if ($attrs->{distinct} && (my $group_by = $attrs->{group_by} || $attrs->{select})) { + if (my $group_by = delete $attrs->{group_by}) { delete $attrs->{having}; my @distinct = (ref $group_by ? @$group_by : ($group_by)); # todo: try CONCAT for multi-column pk diff --git a/t/lib/sqlite.sql b/t/lib/sqlite.sql index aa0d08f..b067ee9 100644 --- a/t/lib/sqlite.sql +++ b/t/lib/sqlite.sql @@ -1,6 +1,6 @@ -- -- Created by SQL::Translator::Producer::SQLite --- Created on Sat May 20 01:05:10 2006 +-- Created on Tue May 23 21:10:54 2006 -- BEGIN TRANSACTION; @@ -105,15 +105,6 @@ CREATE TABLE self_ref ( ); -- --- Table: treelike --- -CREATE TABLE treelike ( - id INTEGER PRIMARY KEY NOT NULL, - parent integer NOT NULL, - name varchar(100) NOT NULL -); - --- -- Table: tags -- CREATE TABLE tags ( diff --git a/t/run/01core.tl b/t/run/01core.tl index 3a3b2fd..eaad538 100644 --- a/t/run/01core.tl +++ b/t/run/01core.tl @@ -1,7 +1,7 @@ sub run_tests { my $schema = shift; -plan tests => 59; +plan tests => 60; # figure out if we've got a version of sqlite that is older than 3.2.6, in # which case COUNT(DISTINCT()) doesn't work