[Bast-commits] r6375 - DBIx-Class/0.08/trunk/lib/DBIx/Class
ash at dev.catalyst.perl.org
ash at dev.catalyst.perl.org
Fri May 22 16:54:00 GMT 2009
Author: ash
Date: 2009-05-22 16:54:00 +0000 (Fri, 22 May 2009)
New Revision: 6375
Modified:
DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
Log:
Make distinct calculate columns *after* prefetch has been resolved. Tests to come
Modified: DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2009-05-22 14:34:51 UTC (rev 6374)
+++ DBIx-Class/0.08/trunk/lib/DBIx/Class/ResultSet.pm 2009-05-22 16:54:00 UTC (rev 6375)
@@ -2608,8 +2608,6 @@
}
- $attrs->{group_by} ||= [ grep { !ref($_) || (ref($_) ne 'HASH') } @{$attrs->{select}} ]
- if delete $attrs->{distinct};
if ( $attrs->{order_by} ) {
$attrs->{order_by} = (
ref( $attrs->{order_by} ) eq 'ARRAY'
@@ -2636,6 +2634,11 @@
}
push( @{ $attrs->{order_by} }, @pre_order );
}
+
+ if (delete $attrs->{distinct}) {
+ $attrs->{group_by} ||= [ grep { !ref($_) || (ref($_) ne 'HASH') } @{$attrs->{select}} ];
+ }
+
$attrs->{collapse} = $collapse;
if ( $attrs->{page} and not defined $attrs->{offset} ) {
More information about the Bast-commits
mailing list