Merge 'oracle_hierarchical_queries_rt39121' into 'trunk'
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBIHacks.pm
index 32e0ea3..6f977de 100644 (file)
@@ -94,6 +94,8 @@ sub _adjust_select_args_for_complex_prefetch {
     }
 
     push @$inner_select, $sel;
+
+    push @{$inner_attrs->{as}}, $attrs->{as}[$i];
   }
 
   # construct the inner $from for the subquery
@@ -238,10 +240,11 @@ sub _resolve_aliastypes_from_select_args {
   local $sql_maker->{quote_char} = "\x00"; # so that we can regex away
 
   # generate sql chunks
+  local $sql_maker->{having_bind};  # these are throw away results
   my $to_scan = {
     restricting => [
       $sql_maker->_recurse_where ($where),
-      $sql_maker->_order_by({
+      $sql_maker->_parse_rs_attrs ({
         map { $_ => $attrs->{$_} } (qw/group_by having/)
       }),
     ],