Skip to content

Commit

Permalink
Bracket ops to avoid precedence issues when compiling expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 18, 2015
1 parent 9157173 commit 26b3685
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/qgssqlexpressioncompiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ QgsSqlExpressionCompiler::Result QgsSqlExpressionCompiler::compileNode( const Qg
if ( failOnPartialNode && ( lr == Partial || rr == Partial ) )
return Fail;

result = left + ' ' + op + ' ' + right;
result = '(' + left + ' ' + op + ' ' + right + ')';
if ( lr == Complete && rr == Complete )
return ( partialCompilation ? Partial : Complete );
else if (( lr == Partial && rr == Complete ) || ( lr == Complete && rr == Partial ) || ( lr == Partial && rr == Partial ) )
Expand Down

0 comments on commit 26b3685

Please sign in to comment.