Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
modify: add rule message for pre check unparsed
  • Loading branch information
iwanghc committed Jul 3, 2024
commit a761cb0242762bac2d31dfee27bf80d1d4f00f48
3 changes: 2 additions & 1 deletion sqle/driver/mysql/audit.go
Original file line number Diff line number Diff line change
Expand Up @@ -1178,7 +1178,8 @@ func (i *MysqlDriverImpl) checkInvalidSelect(stmt *ast.SelectStmt) error {
// checkUnparsedStmt might add more check in future.
func (i *MysqlDriverImpl) checkUnparsedStmt(stmt *ast.UnparsedStmt) error {
if i.cnf.parsingSQLFailureCheckEnable {
i.result.Add(i.cnf.parsingSQLFailureLevel, rulepkg.ConfigParsingSQLFailure, "语法错误或者解析器不支持,请人工确认SQL正确性。")
parsingRule := rulepkg.RuleHandlerMap[rulepkg.ConfigParsingSQLFailure]
i.result.Add(i.cnf.parsingSQLFailureLevel, rulepkg.ConfigParsingSQLFailure, parsingRule.Message)
}
return nil
}
3 changes: 2 additions & 1 deletion sqle/driver/mysql/rule/rule_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -2142,6 +2142,7 @@ var RuleHandlers = []RuleHandler{
Level: driverV2.RuleLevelError,
Category: RuleTypeGlobalConfig,
},
Func: nil,
Message: "语法错误或者解析器不支持,请人工确认SQL正确性。",
Func: nil,
},
}