X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBIHacks.pm;h=eaa41c4c57d707cefea89b5eef51fc2237a7d598;hb=a59246c38852d59fa8ba917fb278aefea43da1e1;hp=1f48bc6c41f34e15e8370cda91be4ded0843c233;hpb=27e0370da6cfee04a24491eaa4ce7aa5c878bafa;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBIHacks.pm b/lib/DBIx/Class/Storage/DBIHacks.pm index 1f48bc6..eaa41c4 100644 --- a/lib/DBIx/Class/Storage/DBIHacks.pm +++ b/lib/DBIx/Class/Storage/DBIHacks.pm @@ -67,7 +67,7 @@ sub _adjust_select_args_for_complex_prefetch { my ($self, $from, $select, $where, $attrs) = @_; $self->throw_exception ('Nothing to prefetch... how did we get here?!') - if not @{$attrs->{_prefetch_selector_range}}; + if not @{$attrs->{_prefetch_selector_range}||[]}; $self->throw_exception ('Complex prefetches are not supported on resultsets with a custom from attribute') if (ref $from ne 'ARRAY' || ref $from->[0] ne 'HASH' || ref $from->[1] ne 'ARRAY'); @@ -76,7 +76,7 @@ sub _adjust_select_args_for_complex_prefetch { my $outer_attrs = { %$attrs }; delete $outer_attrs->{$_} for qw/where bind rows offset group_by having/; - my $inner_attrs = { %$attrs, _is_internal_subuery => 1 }; + my $inner_attrs = { %$attrs }; delete $inner_attrs->{$_} for qw/for collapse _prefetch_selector_range select as/; # if the user did not request it, there is no point using it inside