Fix formating of QuantifiedComparisonExpression
When QuantifiedComparisonExpression is used within other expression then
parenthesis makes a difference, take look at:
(1 = ANY(SELECT 1)) IN (SELECT TRUE)
currently without parenthesis it does not compile (should it?):
1 = ANY(SELECT 1) IN (SELECT TRUE)
@@ -622,6 +622,7 @@ public final class ExpressionFormatter
protected String visitQuantifiedComparisonExpression(QuantifiedComparisonExpression node, Void context)
{
return new StringBuilder()
+ .append("(")
.append(process(node.getValue(), context))
.append(' ')
.append(node.getComparisonType().getValue())
@@ -629,6 +630,7 @@ public final class ExpressionFormatter
.append(node.getQuantifier().toString())
.append(' ')
.append(process(node.getSubquery(), context))
+ .append(")")
.toString();
}
