From: Matt S Trout Date: Mon, 3 Sep 2018 22:43:09 +0000 (+0000) Subject: expander handles literal as RHS X-Git-Tag: v2.000000~3^2~505 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ce3272fe22bf1c076b67f6e9c1c810b7802fff26;p=dbsrgits%2FSQL-Abstract.git expander handles literal as RHS --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index e3a537e..a479468 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 }; }