fix for count after slice (report and tests from JOHANL)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSet.pm
index 8d9f569..75ba410 100644 (file)
@@ -938,6 +938,7 @@ sub count {
   $count -= $self->{_attrs}{offset} if $self->{_attrs}{offset};
   $count = $self->{attrs}{rows} if
     $self->{attrs}{rows} and $self->{attrs}{rows} < $count;
+  $count = 0 if ($count < 0);
   return $count;
 }