From: Matt S Trout Date: Tue, 11 Sep 2018 22:31:18 +0000 (+0000) Subject: eliminated value old special op impl X-Git-Tag: v2.000000~3^2~485 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a582066295a88aef5304a8801efc69a77ba5c38e;p=dbsrgits%2FSQL-Abstract.git eliminated value old special op impl --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index ce48f4a..e932d99 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -40,7 +40,7 @@ my @BUILTIN_SPECIAL_OPS = ( {regex => qr/^ (?: not \s )? between $/ix, handler => sub { die "NOPE" }}, {regex => qr/^ (?: not \s )? in $/ix, handler => sub { die "NOPE" }}, {regex => qr/^ ident $/ix, handler => sub { die "NOPE" }}, - {regex => qr/^ value $/ix, handler => '_where_op_VALUE'}, + {regex => qr/^ value $/ix, handler => sub { die "NOPE" }}, {regex => qr/^ is (?: \s+ not )? $/ix, handler => '_where_field_IS'}, ); @@ -701,6 +701,14 @@ sub _expand_expr_hashpair { { -ident => $vv } ] }; } + if ($vk eq 'value') { + return $self->_expand_expr_hashpair($k, undef) unless defined($vv); + return +{ -op => [ + $self->{cmp}, + { -ident => $k }, + { -bind => [ $k, $vv ] } + ] }; + } } if (ref($v) eq 'ARRAY') { return $self->{sqlfalse} unless @$v;