allow a group by node without a list
Matt S Trout [Fri, 20 Apr 2012 03:52:42 +0000 (03:52 +0000)]
lib/Data/Query/Renderer/SQL/Naive.pm

index 8531a2f..1fdd5ef 100644 (file)
@@ -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;
 }