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-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ee74413eee1d130c53ac869fadfb12774d4b845;p=scpubgit%2FQ-Branch.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; }