From: Matt S Trout Date: Sat, 30 Jul 2011 23:39:10 +0000 (+0000) Subject: disable quoting of function names in apply op X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=54a4653740a48bc6963c9e333e59051de6969d6e;p=dbsrgits%2FData-Query.git disable quoting of function names in apply op --- diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm index 0c6d242..0b168a3 100644 --- a/lib/Data/Query/Renderer/SQL/Naive.pm +++ b/lib/Data/Query/Renderer/SQL/Naive.pm @@ -212,7 +212,14 @@ sub _handle_op_type_apply { my ($func, @args) = @{$dq->{args}}; die "Function name must be identifier" unless $func->{type} eq DQ_IDENTIFIER; - my $ident = $self->_render($func)->[0]; + my $ident = do { + # The problem we have here is that built-ins can't be quoted, generally. + # I rather wonder if things like MAX(...) need to -not- be handled as + # an apply and instead of something else, maybe a parenop type - but + # as an explicitly Naive renderer this seems like a reasonable answer. + local @{$self}{qw(reserved_ident_parts always_quote)}; + $self->_render_identifier($func)->[0]; + }; [ "$ident(", (map $self->_render($_), @args),