Skip to content

Commit

Permalink
update OrVisitor
Browse files Browse the repository at this point in the history
fix bug for case:sql = "select * from order where (a=1 or b=2) and (c=3 or d=4)";
  • Loading branch information
jinfei21 committed Jun 6, 2016
1 parent 53ccfb6 commit 4ab73d0
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ public boolean visit(final SQLBinaryOpExpr x) {
if (Boolean.TRUE.equals(WallVisitorUtils.getValue(x))) {
return false;
}
orASTNode = new SimpleOrASTNode(x, new OrVisitor(this));
if(orASTNode == null){
orASTNode = new SimpleOrASTNode(x, new OrVisitor(this));
}else{

CompositeOrASTNode existingOutConditionOrASTNode = new CompositeOrASTNode();
existingOutConditionOrASTNode.addSubNode(orASTNode);
existingOutConditionOrASTNode.addSubNode(new SimpleOrASTNode(x, new OrVisitor(this)));
orASTNode = existingOutConditionOrASTNode;
}
return false;
}
}

0 comments on commit 4ab73d0

Please sign in to comment.