use mro 'c3';
use Try::Tiny;
-use List::Util 'max';
use DBIx::Class::ResultSource::RowParser::Util qw(
assemble_simple_parser
# coderef later
$collapse_map->{-identifying_columns} = [];
$collapse_map->{-identifying_columns_variants} = [ sort {
- (scalar @$a) <=> (scalar @$b) or max(@$a) <=> max(@$b)
+ (scalar @$a) <=> (scalar @$b)
+ or
+ (
+ # Poor man's max()
+ ( sort { $b <=> $a } @$a )[0]
+ <=>
+ ( sort { $b <=> $a } @$b )[0]
+ )
} @collapse_sets ];
}
}
(undef, $sth) = $self->storage->_select( @{$self->{args}} );
- return (
+ (
DBIx::Class::_ENV_::SHUFFLE_UNORDERED_RESULTSETS
and
! $self->{attrs}{order_by}
+ and
+ require List::Util
)
? List::Util::shuffle( @{$sth->fetchall_arrayref} )
: @{$sth->fetchall_arrayref}
use warnings;
use Test::More;
-
+use List::Util 'min';
use DBICTest ':DiffSQL';
use DBIx::Class::SQLMaker::LimitDialects;
is_deeply(
$rs->all_hri,
- [ @{$hri_contents}[$offset .. List::Util::min( $used_limit+$offset-1, $#$hri_contents)] ],
+ [ @{$hri_contents}[$offset .. min( $used_limit+$offset-1, $#$hri_contents)] ],
"Correct slice of the resultset returned with limit '$limit', offset '$offset'",
);
}
# these envvars *will* bring in more stuff than the baseline
delete @ENV{qw(
DBIC_TRACE
+ DBIC_SHUFFLE_UNORDERED_RESULTSETS
DBICTEST_SQLT_DEPLOY
DBICTEST_SQLITE_REVERSE_DEFAULT_ORDER
DBICTEST_VIA_REPLICATED
Sub::Quote
Scalar::Util
- List::Util
Storable
Class::Accessor::Grouped
my $art = $s->resultset('Artist')->create({ name => \[ '?' => 'foo'], rank => 42 });
$art->discard_changes;
$art->update({ rank => 69, name => 'foo' });
+ $s->resultset('Artist')->all;
assert_no_missing_expected_requires();
}