From: Matt S Trout Date: Thu, 21 Mar 2019 04:04:04 +0000 (+0000) Subject: remove postfix code X-Git-Tag: v1.90_01~358 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f556ee93d452f139fd031a8ed66eabc77f8e7ed0;p=dbsrgits%2FSQL-Abstract.git remove postfix code --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 53a92b0..7212535 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;