From: Matt S Trout Date: Tue, 11 Sep 2018 22:31:18 +0000 (+0000) Subject: eliminated value old special op impl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7d7868d17e2608524af7ba317245a90511e2df57;p=scpubgit%2FQ-Branch.git eliminated value old special op impl --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 0f412aa..c9c89bf 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;