If there was no offset, there is no sense in reordering
[dbsrgits/DBIx-Class.git] / 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;
 }