From: Matt S Trout Date: Thu, 23 Aug 2012 18:27:39 +0000 (+0000) Subject: don't deparenthesise subqueries with a group by X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c922e61cccb0de8d96fbf1700e59d2c7b2bb6faf;p=dbsrgits%2FData-Query.git don't deparenthesise subqueries with a group by --- diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm index c9d356c..96abe9c 100644 --- a/lib/Data/Query/Renderer/SQL/Naive.pm +++ b/lib/Data/Query/Renderer/SQL/Naive.pm @@ -144,7 +144,7 @@ sub _render_operator { sub _maybe_parenthesise { my ($self, $dq) = @_; for ($dq) { - return is_Select() || is_Slice() + return is_Select() || is_Group() || is_Slice() ? [ '(', $self->_render($dq), ')' ] : $self->_render($dq); }