Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Yifan Xu <[email protected]>
  • Loading branch information
time-and-fate and xuyifangreeneyes authored Jan 5, 2023
1 parent 9730c56 commit 0531b23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1611,8 +1611,8 @@ func (a *ExecStmt) LogSlowQuery(txnTS uint64, succ bool, hasMoreResults bool) {
}

func extractMsgFromSQLWarn(SQLWarn *stmtctx.SQLWarn) string {
// Currently, this function is only used in extractMsgFromSQLWarn().
// extractMsgFromSQLWarn() can make sure SQLWarn is not nil so no need to add a nil check here.
// Currently, this function is only used in collectWarningsForSlowLog.
// collectWarningsForSlowLog can make sure SQLWarn is not nil so no need to add a nil check here.
warn := errors.Cause(SQLWarn.Err)
if x, ok := warn.(*terror.Error); ok && x != nil {
sqlErr := terror.ToSQLError(x)
Expand Down

0 comments on commit 0531b23

Please sign in to comment.