fix for sql functions in group_by
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSet.pm
index c8a2d77..b06b497 100644 (file)
@@ -2610,7 +2610,7 @@ sub _resolved_attrs {
 
   }
 
-  $attrs->{group_by} ||= $attrs->{select}
+  $attrs->{group_by} ||= [ grep { !ref($_) || (ref($_) ne 'HASH') } @{$attrs->{select}} ]
     if delete $attrs->{distinct};
   if ( $attrs->{order_by} ) {
     $attrs->{order_by} = (