return (($op eq 'not' || $us ? '('.$final_sql.')' : $final_sql), @bind);
} else {
my @parts = map [ $self->_render_expr($_) ], @args;
- my ($final_sql) = map +($op =~ /^(and|or)$/ ? "( ${_} )" : $_), join(
+ my $is_andor = !!($op =~ /^(and|or)$/);
+ return @{$parts[0]} if $is_andor and @parts == 1;
+ my ($final_sql) = map +($is_andor ? "( ${_} )" : $_), join(
($final_op eq ',' ? '' : ' ').$self->_sqlcase($final_op).' ',
map $_->[0], @parts
);