X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSet.pm;h=74940ebca3b7eacdbd6ca23d47f9beebc7531f85;hb=bc185c328c2881bbafb597ffba48a516f3f8bfeb;hp=6faf118a0c3e6def9db1d8ebc7dfd5093e268198;hpb=ceb52d1911c9cad984a90bcd8debc8a166a9c054;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/ResultSet.pm b/lib/DBIx/Class/ResultSet.pm index 6faf118..74940eb 100644 --- a/lib/DBIx/Class/ResultSet.pm +++ b/lib/DBIx/Class/ResultSet.pm @@ -2605,8 +2605,10 @@ sub _resolved_attrs { # Although this is needed only if the order_by is not defined, it is # actually cheaper to just populate this rather than properly examining # order_by (stuf like [ {} ] and the like) - $attrs->{_virtual_order_by} = [ $self->result_source->primary_columns ]; - + my $prefix = $alias . ($source->schema->storage->_sql_maker_opts->{name_sep} || '.'); + $attrs->{_virtual_order_by} = [ + map { $prefix . $_ } ($source->primary_columns) + ]; $attrs->{collapse} ||= {}; if ( my $prefetch = delete $attrs->{prefetch} ) {