X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FData%2FQuery%2FRenderer%2FSQL%2FNaive.pm;h=1049b4674ea575ed507c3ba27e07c998f5ebd689;hb=839687b2c07760f1cd638836f36e87a69df5ed5b;hp=11117da9858626422737f97f07b6100fab976260;hpb=04d30ecbe4c9a4dac7aed54a91a0c5f858e40d94;p=dbsrgits%2FData-Query.git 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"; }