From: Matt S Trout Date: Thu, 21 Mar 2019 04:04:04 +0000 (+0000) Subject: remove postfix code X-Git-Tag: v2.000000~3^2~379 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35a1272138f5da43aeb4ecdf197bf8fbe7195bf2;p=dbsrgits%2FSQL-Abstract.git remove postfix code --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 12328e5..402a64e 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1033,11 +1033,6 @@ our $RENDER_OP = { ), }; -my %unop_postfix = map +($_ => 1), - 'is null', 'is not null', - 'asc', 'desc', -; - sub _render_op { my ($self, $v) = @_; my ($op, @args) = @$v; @@ -1058,11 +1053,7 @@ sub _render_op { if (@args == 1 and $op !~ /^(and|or)$/) { my ($expr_sql, @bind) = $self->render_aqt($args[0]); my $op_sql = $self->_sqlcase($op); - my $final_sql = ( - $unop_postfix{lc($op)} - ? "${expr_sql} ${op_sql}" - : "${op_sql} ${expr_sql}" - ); + my $final_sql = "${op_sql} ${expr_sql}"; return (($op eq 'not' || $us ? '('.$final_sql.')' : $final_sql), @bind); } else { my @parts = grep length($_->[0]), map [ $self->render_aqt($_) ], @args;