my ($self, @args) = @_;
my %clauses;
@clauses{qw(from select where order_by)} = @args;
+
# This oddity is to literalify since historically SQLA doesn't quote
- # a single identifier argument, and the .'' is to copy $clauses{select}
- # before taking a reference to it to avoid making a reference loop
- $clauses{select}= \(($clauses{select}||'*').'')
- unless ref($clauses{select});
+ # a single identifier argument, so we convert it into a literal
+
+ unless (ref(my $select = $clauses{select}||'*')) {
+ $clauses{select} = \$select;
+ }
my ($sql, @bind) = $self->render_expr({ -select => \%clauses });
return wantarray ? ($sql, @bind) : $sql;
}