From: Matt S Trout Date: Mon, 7 Oct 2013 00:58:36 +0000 (+0000) Subject: don't gensym for unqualified versions of already selected columns X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6b9e9259c9a2e2475e63db7756d0c844ebac54f6;p=dbsrgits%2FData-Query.git don't gensym for unqualified versions of already selected columns --- diff --git a/lib/Data/Query/Renderer/SQL/Slice/SubqueryRemap.pm b/lib/Data/Query/Renderer/SQL/Slice/SubqueryRemap.pm index 631b6be..7f70046 100644 --- a/lib/Data/Query/Renderer/SQL/Slice/SubqueryRemap.pm +++ b/lib/Data/Query/Renderer/SQL/Slice/SubqueryRemap.pm @@ -51,9 +51,15 @@ sub _subquery_remap { my %alias_map = map { if (is_Alias and is_Identifier $_->{from}) { - +(join('.',@{$_->{from}{elements}}) => Identifier($_->{to})) + +( + join('.',@{$_->{from}{elements}}) => Identifier($_->{to}), + $_->{from}{elements}[-1] => Identifier($_->{to}), + ) } elsif (is_Identifier) { - +(join('.',@{$_->{elements}}) => $_) + +( + join('.',@{$_->{elements}}) => $_, + $_->{elements}[-1] => $_, + ) } else { +() }