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');
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