@Override
public boolean visit(MySqlUnionQuery x) {
{
boolean needParen = false;
if (x.getLeft() instanceof MySqlSelectQueryBlock) {
MySqlSelectQueryBlock right = (MySqlSelectQueryBlock) x.getLeft();
if (right.getOrderBy() != null || right.getLimit() != null) {
needParen = true;
}
}
if (needParen) {
print('(');
x.getLeft().accept(this);
print(')');
} else {
x.getLeft().accept(this);
}
}
println();
print(x.getOperator().name);
println();
boolean needParen = false;
if (x.getOrderBy() != null || x.getLimit() != null) {
needParen = true;
} else if (x.getRight() instanceof MySqlSelectQueryBlock) {
MySqlSelectQueryBlock right = (MySqlSelectQueryBlock) x.getRight();
if (right.getOrderBy() != null || right.getLimit() != null) {
needParen = true;
}
}
if (needParen) {