From: Matt S Trout Date: Fri, 20 Apr 2012 10:04:16 +0000 (+0000) Subject: preserve_order option X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9b024bbe5874bf48a1100bc3afbb5cc9f339d144;p=dbsrgits%2FDBIx-Class-Historic.git preserve_order option --- diff --git a/lib/DBIx/Class/SQLMaker.pm b/lib/DBIx/Class/SQLMaker.pm index 88ede1e..35044f4 100644 --- a/lib/DBIx/Class/SQLMaker.pm +++ b/lib/DBIx/Class/SQLMaker.pm @@ -140,9 +140,10 @@ sub select { my %final_attrs = (%{$rs_attrs}, limit => $limit, offset => $offset); if ($offset and $self->limit_requires_order_by_stability_check) { - my $source = $rs_attrs->{_rsroot_rsrc}; + my $source = $rs_attrs->{_rsroot_rsrc}; unless ( $final_attrs{order_is_stable} + = $final_attrs{preserve_order} = $source->schema->storage ->_order_by_is_stable( @final_attrs{qw(from order_by where)} diff --git a/lib/DBIx/Class/SQLMaker/Converter.pm b/lib/DBIx/Class/SQLMaker/Converter.pm index 82fd8b9..1d76ae7 100644 --- a/lib/DBIx/Class/SQLMaker/Converter.pm +++ b/lib/DBIx/Class/SQLMaker/Converter.pm @@ -28,6 +28,9 @@ around _select_to_dq => sub { ), ($attrs->{order_is_stable} ? (order_is_stable => 1) + : ()), + ($attrs->{preserve_order} + ? (preserve_order => 1) : ()) }; };