From: Matt S Trout Date: Mon, 17 Sep 2018 02:02:44 +0000 (+0000) Subject: remove most of the crud from the VALUE op X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=52511ae3bdec6cdddd85e310b76cc325be16c106;p=scpubgit%2FQ-Branch.git remove most of the crud from the VALUE op --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index f5c04a0..66ecd3e 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -919,40 +919,11 @@ sub _where_op_IDENT { } sub _where_op_VALUE { - my $self = shift; - my ($op, $rhs) = splice @_, -2; - - # in case we are called as a top level special op (no '=') - my $lhs = shift; - - # special-case NULL - if (! defined $rhs) { - return defined $lhs - ? $self->_where_hashpair_HASHREF($lhs, { -is => undef }) - : undef - ; - } - - my @bind = - $self->_bindtype( - (defined $lhs ? $lhs : $self->{_nested_func_lhs}), - $rhs, - ) - ; + my ($self, undef, $value) = @_; - return $lhs - ? ( - $self->_convert($self->_quote($lhs)) . ' = ' . $self->_convert('?'), - @bind - ) - : ( - $self->_convert('?'), - @bind, - ) - ; + return ($self->_convert('?'), $self->_bindtype(undef, $value)); } - my %unop_postfix = map +($_ => 1), 'is null', 'is not null'; my %special = (