From: Matt S Trout Date: Fri, 5 Apr 2019 22:10:57 +0000 (+0000) Subject: convert direct to literal for * and single-id select X-Git-Tag: v2.000000~3^2~270 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=91d37de5a9e9689dcccf177fc01e8ef8d3f9730a;p=dbsrgits%2FSQL-Abstract.git convert direct to literal for * and single-id select --- diff --git a/lib/SQL/Abstract/Clauses.pm b/lib/SQL/Abstract/Clauses.pm index a8e5848..b2d682d 100644 --- a/lib/SQL/Abstract/Clauses.pm +++ b/lib/SQL/Abstract/Clauses.pm @@ -64,9 +64,9 @@ sub select { # This oddity is to literalify since historically SQLA doesn't quote # a single identifier argument, so we convert it into a literal - unless (ref(my $select = $clauses{select}||'*')) { - $clauses{select} = \$select; - } + $clauses{select} = { -literal => [ $clauses{select}||'*' ] } + unless ref($clauses{select}); + my ($sql, @bind) = $self->render_expr({ -select => \%clauses }); return wantarray ? ($sql, @bind) : $sql; }