From: Matt S Trout Date: Mon, 16 Apr 2012 14:03:00 +0000 (+0000) Subject: handle nested rather than unrolled joins X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f16c57e952a835a5542cb55b46ad502e762f926c;p=dbsrgits%2FData-Query.git handle nested rather than unrolled joins --- diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm index 3d264e7..8531a2f 100644 --- a/lib/Data/Query/Renderer/SQL/Naive.pm +++ b/lib/Data/Query/Renderer/SQL/Naive.pm @@ -337,8 +337,10 @@ sub _render_join { ',' } }; + my $rhs = $self->_render($right); [ - $self->_render($left), $join, $self->_render($right), + $self->_render($left), $join, + ($right->{type} eq DQ_JOIN ? ('(', $rhs, ')') : $rhs), ($dq->{on} ? ($self->_format_keyword('ON'), $self->_render($dq->{on})) : ())