sub is_ordered {
my ($self) = @_;
- return scalar $self->result_source->storage->_parse_order_by($self->{attrs}{order_by});
+ return scalar $self->result_source->storage->_extract_order_columns($self->{attrs}{order_by});
}
=head2 related_resultset
# add any order_by parts that are not already present in the group_by
# we need to be careful not to add any named functions/aggregates
# i.e. select => [ ... { count => 'foo', -as 'foocount' } ... ]
- for my $chunk ($storage->_parse_order_by($attrs->{order_by})) {
+ for my $chunk ($storage->_extract_order_columns($attrs->{order_by})) {
# only consider real columns (for functions the user got to do an explicit group_by)
my $colinfo = $rs_column_list->{$chunk}
if (
scalar grep
{ ! $collist{$_} }
- ( $rs->result_source->schema->storage->_parse_order_by ($orig_attrs->{order_by} ) )
+ ( $rs->result_source->schema->storage->_extract_order_columns ($orig_attrs->{order_by} ) )
) {
# nuke the prefetch before collapsing to sql
my $subq_rs = $rs->search;
if (
$sql !~ /^ \s* SELECT \s+ TOP \s+ \d+ \s+ /xi
&&
- scalar $self->_parse_order_by ($attrs->{order_by})
+ scalar $self->_extract_order_columns ($attrs->{order_by})
) {
$self->throw_exception(
'An ordered subselect encountered - this is not safe! Please see "Ordered Subselects" in DBIx::Class::Storage::DBI::MSSQL
_resolve_column_info
_prune_unused_joins
_strip_cond_qualifiers
- _parse_order_by
+ _extract_order_columns
_resolve_aliastypes_from_select_args
_execute
_do_query
}),
],
selecting => [
- $self->_parse_order_by ($attrs->{order_by}, $sql_maker),
+ $self->_extract_order_columns ($attrs->{order_by}, $sql_maker),
$sql_maker->_recurse_fields ($select),
],
};
return $cond;
}
-sub _parse_order_by {
+sub _extract_order_columns {
my ($self, $order_by, $sql_maker) = @_;
my $parser = sub {