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

fingerprint verbose mode add id

上级 342fd27e
...@@ -131,10 +131,15 @@ func main() { ...@@ -131,10 +131,15 @@ func main() {
// +++++++++++++++++++++小工具集[开始]+++++++++++++++++++++++{ // +++++++++++++++++++++小工具集[开始]+++++++++++++++++++++++{
fingerprint := strings.TrimSpace(query.Fingerprint(sql)) fingerprint := strings.TrimSpace(query.Fingerprint(sql))
// SQL 签名
id = query.Id(fingerprint)
currentDB = env.CurrentDB(sql, currentDB) currentDB = env.CurrentDB(sql, currentDB)
switch common.Config.ReportType { switch common.Config.ReportType {
case "fingerprint": case "fingerprint":
// SQL 指纹 // SQL 指纹
if common.Config.Verbose {
fmt.Printf("-- ID: %s\n", id)
}
fmt.Println(fingerprint) fmt.Println(fingerprint)
continue continue
case "pretty": case "pretty":
...@@ -167,8 +172,6 @@ func main() { ...@@ -167,8 +172,6 @@ func main() {
common.LogIfWarn(err, "") common.LogIfWarn(err, "")
continue continue
default: default:
// SQL 签名
id = query.Id(fingerprint)
// 建议去重,减少评审整个文件耗时 // 建议去重,减少评审整个文件耗时
// TODO: 由于 a = 11 和 a = '11' 的 fingerprint 相同,这里一旦跳过即无法检查有些建议了,如: ARG.003 // TODO: 由于 a = 11 和 a = '11' 的 fingerprint 相同,这里一旦跳过即无法检查有些建议了,如: ARG.003
if _, ok := suggestMerged[id]; ok { if _, ok := suggestMerged[id]; ok {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册