Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
djshow832 committed Dec 19, 2019
1 parent 1400ce5 commit 729e4c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions util/stmtsummary/statement_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ type stmtSummaryByDigestKey struct {
}

// Hash implements SimpleLRUCache.Key.
// Only when current SQL is `commit` do we record `prevSQL`. Otherwise, `prevSQL` is empty.
// `prevSQL` is included in the key To distinguish different transactions.
func (key *stmtSummaryByDigestKey) Hash() []byte {
if len(key.hash) == 0 {
key.hash = make([]byte, 0, len(key.schemaName)+len(key.digest)+len(key.prevDigest))
Expand Down

0 comments on commit 729e4c4

Please sign in to comment.