From: Matt S Trout Date: Thu, 21 Mar 2019 05:32:24 +0000 (+0000) Subject: extract another andor case X-Git-Tag: v2.000000~3^2~366 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bbd9890c1f9d87042454809503241a8d09039ab3;p=dbsrgits%2FSQL-Abstract.git extract another andor case --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index eefa36b..6234b98 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 ] };