X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=68593da26ed9609ee9148fadc686d85fd39def71;hb=41eac66492bf7c8a93b0a057ed5bd44b712cebb2;hp=8e303b89ecf758cd062eb488de6c465d35999d23;hpb=fa394969469fd18a6d99798ae0769e160c7e0e56;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 8e303b8..68593da 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -42,7 +42,6 @@ __PACKAGE__->mk_group_accessors('inherited' => qw/ /); __PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks'); - # Each of these methods need _determine_driver called before itself # in order to function reliably. This is a purely DRY optimization my @rdbms_specific_methods = qw/ @@ -1874,7 +1873,7 @@ sub _select_args { #limited has_many ( $attrs->{rows} && keys %{$attrs->{collapse}} ) || - # limited prefetch with RNO subqueries + # limited prefetch with RNO subqueries (otherwise a risk of column name clashes) ( $attrs->{rows} && @@ -1885,7 +1884,7 @@ sub _select_args { @{$attrs->{_prefetch_select}} ) || - # grouped prefetch + # grouped prefetch (to satisfy group_by == select) ( $attrs->{group_by} && @{$attrs->{group_by}} @@ -1900,6 +1899,8 @@ sub _select_args { } elsif ( + # the RNO limit dialect mangles the SQL such that the join gets lost + # wrap a subquery here ($attrs->{rows} || $attrs->{offset}) && $sql_maker->limit_dialect eq 'RowNumberOver' @@ -1908,8 +1909,6 @@ sub _select_args { && scalar $self->_parse_order_by ($attrs->{order_by}) ) { - # the RNO limit dialect above mangles the SQL such that the join gets lost - # wrap a subquery here push @limit, delete @{$attrs}{qw/rows offset/};