From: Matt S Trout Date: Wed, 27 Mar 2019 04:22:11 +0000 (+0000) Subject: make , special cased to avoid premature generalisation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=df7bba54fe06436b7be3b291aa385228a782d63e;p=scpubgit%2FQ-Branch.git make , special cased to avoid premature generalisation --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 6df60d8..6f71756 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -248,7 +248,7 @@ sub new { ), (not => '_render_op_not'), (map +($_ => '_render_op_andor'), qw(and or)), - ',' => sub { shift->_render_op_multop(@_, 1) }, + ',' => '_render_op_multop', }; return bless \%opt, $class; @@ -1191,12 +1191,12 @@ sub _render_op_andor { } sub _render_op_multop { - my ($self, $op, $args, $strip_left) = @_; + my ($self, $op, $args) = @_; my @parts = grep length($_->[0]), map [ $self->render_aqt($_) ], @$args; return '' unless @parts; return @{$parts[0]} if @parts == 1; my ($final_sql) = join( - ($strip_left ? '' : ' ').$self->_sqlcase(join ' ', split '_', $op).' ', + ($op eq ',' ? '' : ' ').$self->_sqlcase(join ' ', split '_', $op).' ', map $_->[0], @parts ); return (