Skip to content

Commit

Permalink
fix #282 -report-type json wrong score
Browse files Browse the repository at this point in the history
  • Loading branch information
martianzhang committed May 26, 2021
1 parent dd44876 commit 9a47ddc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions advisor/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9a47ddc

Please sign in to comment.