From: Matt S Trout Date: Tue, 26 Mar 2019 04:41:22 +0000 (+0000) Subject: few more comments X-Git-Tag: v1.90_01~301 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0cdafc4b91de4c1e155784af239c13327aa7faa8;p=dbsrgits%2FSQL-Abstract.git few more comments --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 432fc20..c065f2c 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -646,9 +646,15 @@ sub _expand_expr_hashpair_ident { if (!ref($v) or Scalar::Util::blessed($v)) { return $self->_expand_expr_hashpair_scalar($k, $v); } + + # single key hashref is a hashtriple + if (ref($v) eq 'HASH') { return $self->_expand_expr_hashtriple($k, %$v); } + + # arrayref needs re-engineering over the elements + if (ref($v) eq 'ARRAY') { return $self->sqlfalse unless @$v; $self->_debug("ARRAY($k) means distribute over elements"); @@ -661,6 +667,7 @@ sub _expand_expr_hashpair_ident { $logic => $v, $k ); } + if (my $literal = is_literal_value($v)) { unless (length $k) { belch 'Hash-pairs consisting of an empty string with a literal are deprecated, and will be removed in 2.0: use -and => [ $literal ] instead';