[Bast-commits] r5759 - DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class

arcanez at dev.catalyst.perl.org arcanez at dev.catalyst.perl.org
Mon Mar 16 15:48:28 GMT 2009


Author: arcanez
Date: 2009-03-16 15:48:28 +0000 (Mon, 16 Mar 2009)
New Revision: 5759

Modified:
   DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class/ResultSet.pm
Log:
don't remove the where clause unless we're doing distinct, it needs to be there

Modified: DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class/ResultSet.pm
===================================================================
--- DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class/ResultSet.pm	2009-03-15 16:14:56 UTC (rev 5758)
+++ DBIx-Class/0.08/branches/count_distinct/lib/DBIx/Class/ResultSet.pm	2009-03-16 15:48:28 UTC (rev 5759)
@@ -1163,13 +1163,14 @@
 
     $attrs->{select} = $group_by; 
     $attrs->{from} = [ { 'mesub' => (ref $self)->new($self->result_source, $attrs)->cursor->as_query } ];
+    delete $attrs->{where};
   }
 
   $attrs->{select} = { count => '*' };
   $attrs->{as} = [qw/count/];
 
   # offset, order by, group by, where and page are not needed to count. record_filter is cdbi
-  delete $attrs->{$_} for qw/rows offset order_by group_by where page pager record_filter/;
+  delete $attrs->{$_} for qw/rows offset order_by group_by page pager record_filter/;
 
   my $tmp_rs = (ref $self)->new($self->result_source, $attrs);
   my ($count) = $tmp_rs->cursor->next;




More information about the Bast-commits mailing list