From: Matt S Trout Date: Sun, 17 Jul 2011 02:25:09 +0000 (+0000) Subject: pass SELECT's FROM+etc. through DQ X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7c15a1ff263e3bcfbb1cf2ea62d4b9621e7d8d71;p=dbsrgits%2FSQL-Abstract.git pass SELECT's FROM+etc. through DQ --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 6a04b42..894390e 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -384,7 +384,7 @@ sub select { my($where_sql, @bind) = $self->where($where, $order); - my $select = $self->_render_dq({ + my $sql = $self->_render_dq({ type => DQ_SELECT, select => [ map +{ @@ -392,9 +392,12 @@ sub select { elements => [ split /\Q$self->{name_sep}/, $_ ], }, ref($fields) eq 'ARRAY' ? @$fields : $fields ], + from => { + type => DQ_LITERAL, + subtype => 'SQL', + literal => $table.$where_sql + } }); - my $sql = join(' ', $select, $self->_sqlcase('from'), $table) - . $where_sql; return wantarray ? ($sql, @bind) : $sql; }