If there was no offset, there is no sense in reordering
Peter Rabbitson [Wed, 5 May 2010 09:11:32 +0000 (09:11 +0000)]
lib/DBIx/Class/SQLAHacks.pm

index 7cfe8fc..d6abcba 100644 (file)
@@ -381,7 +381,7 @@ sub _Top {
     $sql,
     $quoted_rs_alias,
     $order_by_requested,
-  ) if ($order_by_requested || ($mid_sel ne $out_sel));
+  ) if ( ($offset && $order_by_requested) || ($mid_sel ne $out_sel) );
 
   return $sql;
 }