Revision history for DBIx::Class
+ - count no longer returns negative values after slice
+ (report and test from JOHANL)
- rebless before building datetime_parser
(patch from mattlaw / Matt Lawrence)
$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;
}
eval "use DBD::SQLite";
plan $@
? ( skip_all => 'needs DBD::SQLite for testing' )
- : ( tests => 63 );
+ : ( tests => 64 );
}
# figure out if we've got a version of sqlite that is older than 3.2.6, in
);
cmp_ok( scalar $rs->all, '==', scalar $rs->slice(0, $rs->count - 1), 'slice() with join has same count as all()' );
+ok(!$rs->slice($rs->count+1000, $rs->count+1002)->count,
+ 'Slicing beyond end of rs returns a zero count');
+
$rs = $schema->resultset("Artist")->search(
{ 'liner_notes.notes' => 'Kill Yourself!' },
{ join => { 'cds' => 'liner_notes' } });