From: Matt S Trout Date: Wed, 5 Dec 2012 13:33:04 +0000 (+0000) Subject: nested where nodes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a4ccc49e8243dff6809b2327960721ab696bbce9;p=dbsrgits%2FData-Query.git nested where nodes --- diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm index 07a9d50..19c2288 100644 --- a/lib/Data/Query/Renderer/SQL/Naive.pm +++ b/lib/Data/Query/Renderer/SQL/Naive.pm @@ -359,6 +359,10 @@ sub _render_join { sub _render_where { my ($self, $dq) = @_; my ($from, $where) = @{$dq}{qw(from where)}; + while (is_Where $from) { + $where = Operator({ 'SQL.Naive' => 'and' }, [ $where, $from->{where} ]); + $from = $from->{from}; + } my $keyword = (is_Group($from) ? 'HAVING' : 'WHERE'); [ ($from ? $self->_render($from) : ()),