Always reselect a bind-containing order by even if appearing in the select list
Peter Rabbitson [Thu, 29 Mar 2012 02:53:28 +0000 (04:53 +0200)]
lib/DBIx/Class/SQLMaker/LimitDialects.pm

index 1c16805..e91a0c5 100644 (file)
@@ -717,7 +717,9 @@ sub _subqueried_limit_attrs {
       ,
     };
 
-    $in_sel_index->{$sql_sel}++;
+    # anything with a placeholder in it needs re-selection
+    $in_sel_index->{$sql_sel}++ unless $sql_sel =~ / (?: ^ | \W ) \? (?: \W | $ ) /x;
+
     $in_sel_index->{$self->_quote ($sql_alias)}++ if $sql_alias;
 
     # record unqualified versions too, so we do not have