my $rsrc = $self->result_source;
my $attrs = $self->_resolved_attrs;
+
+ if (!$fetch_all and ! $attrs->{order_by} and $attrs->{collapse}) {
+ # default order for collapsing unless the user asked for something
+ $attrs->{order_by} = [ map { join '.', $attrs->{alias}, $_} $rsrc->primary_columns ];
+ $attrs->{_ordered_for_collapse} = 1;
+ $attrs->{_order_is_artificial} = 1;
+ }
+
my $cursor = $self->cursor;
# this will be used as both initial raw-row collector AND as a RV of
}
}
- if (! $attrs->{order_by} and $attrs->{collapse}) {
- # default order for collapsing unless the user asked for something
- $attrs->{order_by} = [ map { "$alias.$_" } $source->primary_columns ];
- $attrs->{_ordered_for_collapse} = 1;
- $attrs->{_order_is_artificial} = 1;
- }
-
# if both page and offset are specified, produce a combined offset
# even though it doesn't make much sense, this is what pre 081xx has
# been doing