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

fix #282 -report-type json wrong score

上级 dd44876e
......@@ -1516,6 +1516,10 @@ func formatJSON(sql string, db string, suggest map[string]Rule) string {
common.Log.Error("formatJSON strconv.Atoi error: %s, item: %s, serverity: %s", err.Error(), item, suggest[item].Severity)
}
score = score - l*5
// ## MySQL execute failed
if strings.HasPrefix(item, "ERR") {
score = 0
}
}
if score < 0 {
score = 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册