# without having to contruct the full hash
if (keys %collapse) {
- my %pri = map { ($_ => 1) } $self->result_source->primary_columns;
+ my %pri = map { ($_ => 1) } $self->result_source->_pri_cols;
foreach my $i (0 .. $#construct_as) {
next if defined($construct_as[$i][0]); # only self table
if (delete $pri{$construct_as[$i][1]}) {
$sub_attrs->{select} = $rsrc->storage->_subq_count_select ($rsrc, $attrs);
- # this is so that the query can be simplified e.g.
- # * ordering can be thrown away in things like Top limit
- $sub_attrs->{-for_count_only} = 1;
-
my $sub_rs = $rsrc->resultset_class->new ($rsrc, $sub_attrs);
$attrs->{from} = [{
producer => $producer,
name => 'harry',
}, {
- key => 'primary,
+ key => 'primary',
});