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
ON producer_2.producerid = cd_to_producer_2.producer
JOIN artist artist ON artist.artistid = me.artist
WHERE ( ( producer.name = ? AND producer_2.name = ? ) )
- ORDER BY me.cdid
)',
[
[ { sqlt_datatype => 'varchar', dbic_colname => 'producer.name', sqlt_size => 100 }
LEFT JOIN track tracks
ON tracks.cd = me.cdid
WHERE me.artist != ?
- ORDER BY me.cdid
)',
[
LEFT JOIN track tracks
ON tracks.cd = me.cdid
WHERE me.artist != ?
- ORDER BY me.cdid
)',
[
GROUP BY me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track
) me
JOIN artist artist ON artist.artistid = me.artist
- ORDER BY me.cdid
)',
[],
);
WHERE ( tracks.title != ? )
GROUP BY me.cdid, me.artist, me.title, me.year, me.genreid, me.single_track,
artist.artistid, artist.name, artist.rank, artist.charfield
- ORDER BY me.cdid
)',
[ map { [ { sqlt_datatype => 'varchar', sqlt_size => 100, dbic_colname => 'tracks.title' }
=> 'ugabuganoexist' ] } (1,2)
JOIN artist artist ON artist.artistid = me.artist
LEFT JOIN cd cds ON cds.artist = artist.artistid
LEFT JOIN artist artist_2 ON artist_2.artistid = cds.artist
- ORDER BY me.cdid
)',
[],
);
JOIN artist artist
ON artist.artistid = me.artist
WHERE ( ( artist.name = ? AND me.year = ? ) )
- ORDER BY me.cdid
)',
[
[ { sqlt_datatype => 'varchar', sqlt_size => 100, dbic_colname => 'artist.name' } => 'foo' ],
) me
LEFT JOIN books books
ON books.owner = me.id
- ORDER BY me.id
)',
[
[ { sqlt_datatype => 'integer' } => 3 ],
) me
LEFT JOIN books books
ON books.owner = me.id
- ORDER BY me.id
)',
[
[ { sqlt_datatype => 'integer' } => 1 ],
) me
LEFT JOIN books books
ON books.owner = me.id
- ORDER BY me.id
)',
[
[ { sqlt_datatype => 'integer' } => 1 ],
) me
LEFT JOIN books books
ON books.owner = me.id
- ORDER BY me.id
)',
[
[ { sqlt_datatype => 'integer' } => 3 ],
) me
LEFT JOIN books books
ON books.owner = me.id
- ORDER BY me.id
)',
[
[ { sqlt_datatype => 'integer' } => 2 ],
) me
LEFT JOIN books books
ON books.owner = me.id
- ORDER BY me.id
)',
[
[ { sqlt_datatype => 'integer' } => 2 ],
) me
LEFT JOIN books books
ON books.owner = me.id
- ORDER BY me.id
)',
[],
],
) me
LEFT JOIN books books
ON books.owner = me.id
- ORDER BY me.id
)',
[],
],