From: Matt S Trout Date: Thu, 18 Apr 2019 02:05:29 +0000 (+0000) Subject: between and in cleanup X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=943e8554d8273044bd5a28b410875128e0f90459;p=scpubgit%2FQ-Branch.git between and in cleanup --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index b658243..9ac6ae2 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1145,34 +1145,24 @@ sub _render_op_between { unless $low->{-literal}; $low; } else { - +($low, [ $self->_sqlcase('and') ], $high); + +($low, $self->format_keyword('and'), $high); } }; - my ($lhsql, @lhbind) = $self->render_aqt($left); return $self->join_query_parts(' ', - [ '(' ], - $left, - [ $self->format_keyword($op) ], - @rh, - [ ')' ], + '(', $left, $self->format_keyword($op), @rh, ')', ); } sub _render_op_in { my ($self, $op, $args) = @_; my ($lhs, @rhs) = @$args; - my @in_bind; - my @in_sql = map { - my ($sql, @bind) = $self->render_aqt($_); - push @in_bind, @bind; - $sql; - } @rhs; - my ($lhsql, @lbind) = $self->render_aqt($lhs); - return ( - $lhsql.' '.$self->_sqlcase(join ' ', split '_', $op).' ( ' - .join(', ', @in_sql) - .' )', - @lbind, @in_bind + + return $self->join_query_parts(' ', + $lhs, + $self->format_keyword($op), + '(', + [ $self->join_query_parts(', ', @rhs) ], + ')' ); }