bug fix for sql wall

This commit is contained in:
高铁
2019-08-27 18:22:13 +08:00
parent d2b12bc586
commit df7ef2fd66
2 changed files with 31 additions and 0 deletions
@@ -288,6 +288,20 @@ public class WallVisitorUtils {
return;
}
List<SQLCommentHint> hints = x.getHintsDirect();
if (hints != null
&& x.getParent() instanceof SQLUnionQuery
&& x == ((SQLUnionQuery) x.getParent()).getRight()
) {
for (SQLCommentHint hint : hints) {
String text = hint.getText();
if (text.startsWith("!")) {
addViolation(visitor, ErrorCode.UNION, "union select hint not allow", x);
return;
}
}
}
SQLExpr where = x.getWhere();
if (where != null) {
checkCondition(visitor, x.getWhere());