From: Matt S Trout Date: Mon, 3 Sep 2018 22:43:09 +0000 (+0000) Subject: expander handles literal as RHS X-Git-Tag: v1.90_01~484 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=331e2209e8a151082fb8f20f11545a5472723832;p=dbsrgits%2FSQL-Abstract.git expander handles literal as RHS --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 8a543e2..03b5a93 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -560,6 +560,14 @@ sub _expand_expr_hashpair { if ($k eq '-nest') { return $self->_expand_expr($v); } + if ($k !~ /^-/ and 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'; + return \$literal; + } + my ($sql, @bind) = @$literal; + return \[ $self->_quote($k).' '.$sql, @bind ]; + } return { $k => $v }; }