I think this time I have the weird AS-defaulting "logic" correctly ported
Matt S Trout [Mon, 7 Oct 2013 00:14:20 +0000 (00:14 +0000)]
lib/DBIx/Class/SQLMaker.pm

index cb0439e..6ed9c19 100644 (file)
@@ -197,7 +197,10 @@ sub select {
         my $f = $fields->[$_];
         if (ref $f) {
           $f = { '' => $f } unless ref($f) eq 'HASH';
-          $f->{-as} ||= $final_attrs{as}[$_];
+          ($f->{-as} ||= $final_attrs{as}[$_]) =~ s/\Q${\$self->name_sep}/__/g;
+        } elsif ($f !~ /^\Q$final_attrs{alias}${\$self->name_sep}/) {
+          $f = { '' => $f };
+          ($f->{-as} ||= $final_attrs{as}[$_]) =~ s/\Q${\$self->name_sep}/__/g;
         }
         $f;
         } 0 .. $#$fields ];