From: Matt S Trout Date: Sat, 8 Sep 2018 00:02:47 +0000 (+0000) Subject: expand hashpair w/hash RHS X-Git-Tag: v2.000000~3^2~496 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=28a7cc91ead2f44e200976c61916b03888c79f50;p=dbsrgits%2FSQL-Abstract.git expand hashpair w/hash RHS --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index de447fa..86e2060 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -622,6 +622,12 @@ sub _expand_expr_hashpair { ] }; } + if (ref($v) eq 'HASH' and keys %$v > 1) { + return { -and => [ + map $self->_expand_expr_hashpair($k => { $_ => $v->{$_} }), + sort keys %$v + ] }; + } if (ref($v) eq 'ARRAY') { return $self->{sqlfalse} unless @$v; $self->_debug("ARRAY($k) means distribute over elements");