提交 ea0e68f2 编写于 作者: martianzhang's avatar martianzhang

by pass sub querey for ARG.014, ARG.004, ARG.005

上级 1ab0ac83
......@@ -2636,6 +2636,10 @@ func (q *Query4Audit) RuleIn() Rule {
switch strings.ToLower(n.Operator) {
case "in":
switch r := n.Right.(type) {
case *sqlparser.Subquery:
// by pass sub query
// id in (select id from tb where xxx)
break
case sqlparser.ColTuple:
// id in (1, 2, id), always true.
rule = HeuristicRules["ARG.014"]
......@@ -2653,6 +2657,8 @@ func (q *Query4Audit) RuleIn() Rule {
rule = HeuristicRules["ARG.005"]
return false, nil
}
//default: // debug
// fmt.Println("Type: ", reflect.TypeOf(n.Right).String())
}
case "not in":
switch r := n.Right.(type) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册