From: Matt S Trout Date: Fri, 20 Apr 2012 03:52:42 +0000 (+0000) Subject: allow a group by node without a list X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a010d224f7f3c2cbd91c665ea0c3fb5784533480;p=dbsrgits%2FData-Query.git allow a group by node without a list --- diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm index 8531a2f..1fdd5ef 100644 --- a/lib/Data/Query/Renderer/SQL/Naive.pm +++ b/lib/Data/Query/Renderer/SQL/Naive.pm @@ -385,8 +385,12 @@ sub _render_group { # move somewhere else just yet. my @ret = ( ($dq->{from} ? $self->_render($dq->{from}) : ()), - $self->_format_keyword('GROUP BY'), - intersperse(',', map $self->_render($_), @{$dq->{by}}) + (@{$dq->{by}} + ? ( + $self->_format_keyword('GROUP BY'), + intersperse(',', map $self->_render($_), @{$dq->{by}}) + ) + : ()) ); \@ret; }