Skip to content
Merged
Changes from all commits
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
4 changes: 3 additions & 1 deletion internal/sql-analyzer/analyzer/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ func (m *Manager) Analyze(sql string, indexes []model.IndexInfo) []model.SqlDiag
logger.Debugf("[Manager] Rule %s returned %d results", r.Name(), len(results))
if len(results) > 0 {
mu.Lock()
diagnostics = append(diagnostics, results...)
// Only keep the first result for each rule, currently each rule returns the same record, can be enriched to include the detailed sql statement part.
diagnostics = append(diagnostics, results[0])
mu.Unlock()
}
}(rule)
}
wg.Wait()

logger.Debugf("[Manager] Total diagnostics found: %d", len(diagnostics))

return diagnostics
Expand Down