From: Matt S Trout Date: Thu, 21 Mar 2019 05:32:24 +0000 (+0000) Subject: extract another andor case X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fb7d8ea637534ec0002d21c1f3f88aeebe02a6f8;p=scpubgit%2FQ-Branch.git extract another andor case --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index b9982ae..e2f4d34 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -697,13 +697,10 @@ sub _expand_expr_hashpair { return +{ -op => [ $op.' null', $self->_expand_ident(-ident => $k) ] }; } if ($op =~ /^(and|or)$/) { - if (ref($vv) eq 'HASH') { - return +{ -op => [ - $op, - map $self->_expand_expr({ $k, { $_ => $vv->{$_} } }), - sort keys %$vv - ] }; - } + return $self->_expand_andor('-'.$op, [ + map +{ $k, { $_ => $vv->{$_} } }, + sort keys %$vv + ]); } if (my $us = List::Util::first { $op =~ $_->{regex} } @{$self->{special_ops}}) { return { -op => [ $op, $self->_expand_ident(-ident => $k), $vv ] };