preserve_order option
Matt S Trout [Fri, 20 Apr 2012 10:04:16 +0000 (10:04 +0000)]
lib/DBIx/Class/SQLMaker.pm
lib/DBIx/Class/SQLMaker/Converter.pm

index 88ede1e..35044f4 100644 (file)
@@ -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)}
index 82fd8b9..1d76ae7 100644 (file)
@@ -28,6 +28,9 @@ around _select_to_dq => sub {
     ),
     ($attrs->{order_is_stable}
       ? (order_is_stable => 1)
+      : ()),
+    ($attrs->{preserve_order}
+      ? (preserve_order => 1)
       : ())
   };
 };