From: Matt S Trout Date: Sun, 31 Jul 2011 05:44:52 +0000 (+0000) Subject: parens around BETWEEN X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=839687b2c07760f1cd638836f36e87a69df5ed5b;hp=04d30ecbe4c9a4dac7aed54a91a0c5f858e40d94;p=dbsrgits%2FData-Query.git parens around BETWEEN --- diff --git a/lib/Data/Query/Renderer/SQL/Naive.pm b/lib/Data/Query/Renderer/SQL/Naive.pm index 11117da..1049b46 100644 --- a/lib/Data/Query/Renderer/SQL/Naive.pm +++ b/lib/Data/Query/Renderer/SQL/Naive.pm @@ -210,10 +210,10 @@ sub _handle_op_type_between { my @args = @{$dq->{args}}; if (@args == 3) { my ($lhs, $rhs1, $rhs2) = (map $self->_render($_), @args); - [ $lhs, $op_name, $rhs1, 'AND', $rhs2 ]; + [ '(', $lhs, $op_name, $rhs1, 'AND', $rhs2, ')' ]; } elsif (@args == 2 and $args[1]->{type} eq DQ_LITERAL) { my ($lhs, $rhs) = (map $self->_render($_), @args); - [ $lhs, $op_name, $rhs ]; + [ '(', $lhs, $op_name, $rhs, ')' ]; } else { die "Invalid args for between: ${\scalar @args} given"; }