diff --git a/evaluator/builtin_other.go b/evaluator/builtin_other.go index f014074b68254..2e1607ad6173d 100644 --- a/evaluator/builtin_other.go +++ b/evaluator/builtin_other.go @@ -35,7 +35,7 @@ func builtinSleep(args []types.Datum, ctx context.Context) (d types.Datum, err e sessVars := variable.GetSessionVars(ctx) if args[0].IsNull() { if sessVars.StrictSQLMode { - return d, errors.New("Incorrect arguments to sleep.") + return d, errors.New("incorrect arguments to sleep") } d.SetInt64(0) return @@ -48,7 +48,7 @@ func builtinSleep(args []types.Datum, ctx context.Context) (d types.Datum, err e } if ret == -1 { if sessVars.StrictSQLMode { - return d, errors.New("Incorrect arguments to sleep.") + return d, errors.New("incorrect arguments to sleep") } d.SetInt64(0) return diff --git a/executor/adapter.go b/executor/adapter.go index d0dd348b23a66..fc30a53345667 100644 --- a/executor/adapter.go +++ b/executor/adapter.go @@ -111,7 +111,7 @@ func (a *statement) Exec(ctx context.Context) (ast.RecordSet, error) { case *DeleteExec, *InsertExec, *UpdateExec, *ReplaceExec, *LoadData, *DDLExec: snapshotTS := variable.GetSnapshotTS(ctx) if snapshotTS != 0 { - return nil, errors.New("Can not execute write statement when 'tidb_snapshot' is set.") + return nil, errors.New("can not execute write statement when 'tidb_snapshot' is set") } } diff --git a/executor/builder.go b/executor/builder.go index 32f63a018e24b..918b648ec03de 100644 --- a/executor/builder.go +++ b/executor/builder.go @@ -568,7 +568,7 @@ func (b *executorBuilder) buildIndexScan(v *plan.PhysicalIndexScan) Executor { st.scanConcurrency, b.err = getScanConcurrency(b.ctx) return st } - b.err = errors.New("Not implement yet.") + b.err = errors.New("not implement yet") return nil } diff --git a/executor/executor.go b/executor/executor.go index b186151a2b168..77c3c1ca607c1 100644 --- a/executor/executor.go +++ b/executor/executor.go @@ -1855,7 +1855,7 @@ func (e *MaxOneRowExec) Next() (*Row, error) { return nil, errors.Trace(err) } if srcRow1 != nil { - return nil, errors.New("Subquery returns more than 1 row.") + return nil, errors.New("subquery returns more than 1 row") } return srcRow, nil } diff --git a/executor/grant.go b/executor/grant.go index f29dd0cce77db..503f7ce29ac68 100644 --- a/executor/grant.go +++ b/executor/grant.go @@ -491,7 +491,7 @@ func (e *GrantExec) getTargetSchema() (*model.DBInfo, error) { // Grant *, use current schema dbName = db.GetCurrentSchema(e.ctx) if len(dbName) == 0 { - return nil, errors.New("Miss DB name for grant privilege.") + return nil, errors.New("miss DB name for grant privilege") } } //check if db exists diff --git a/executor/show.go b/executor/show.go index 06d8fc84329e5..d4ff40898733f 100644 --- a/executor/show.go +++ b/executor/show.go @@ -529,7 +529,7 @@ func (e *ShowExec) fetchShowGrants() error { // Get checker checker := privilege.GetPrivilegeChecker(e.ctx) if checker == nil { - return errors.New("Miss privilege checker!") + return errors.New("miss privilege checker") } gs, err := checker.ShowGrants(e.ctx, e.User) if err != nil { diff --git a/plan/logical_plan_builder.go b/plan/logical_plan_builder.go index b506aba29d94f..20321adf93e45 100644 --- a/plan/logical_plan_builder.go +++ b/plan/logical_plan_builder.go @@ -212,7 +212,7 @@ func (b *planBuilder) buildJoin(join *ast.Join) LogicalPlan { return nil } if correlated { - b.err = errors.New("On condition doesn't support subqueries yet.") + b.err = errors.New("ON condition doesn't support subqueries yet") } onCondition := expression.SplitCNFItems(onExpr) eqCond, leftCond, rightCond, otherCond := extractOnCondition(onCondition, leftPlan, rightPlan) diff --git a/plan/planbuilder.go b/plan/planbuilder.go index 09f0d926ab5dc..6b162fd9d918b 100644 --- a/plan/planbuilder.go +++ b/plan/planbuilder.go @@ -134,7 +134,7 @@ func (b *planBuilder) extractSelectAgg(sel *ast.SelectStmt) []*ast.AggregateFunc for _, f := range sel.GetResultFields() { n, ok := f.Expr.Accept(extractor) if !ok { - b.err = errors.New("Failed to extract agg expr!") + b.err = errors.New("failed to extract agg expr") return nil } ve, ok := f.Expr.(*ast.ValueExpr) diff --git a/plan/resolver.go b/plan/resolver.go index 5285fddcd19e6..e0307d6e9e758 100644 --- a/plan/resolver.go +++ b/plan/resolver.go @@ -723,7 +723,7 @@ func (nr *nameResolver) createResultFields(field *ast.SelectField) (rfs []*ast.R ctx := nr.currentContext() if field.WildCard != nil { if len(ctx.tables) == 0 { - nr.Err = errors.New("No table used.") + nr.Err = errors.New("no table used") return } tableRfs := []*ast.ResultField{} diff --git a/session.go b/session.go index 2b1cc3e4f7d5a..b8046d8224fa8 100644 --- a/session.go +++ b/session.go @@ -339,7 +339,7 @@ func (s *session) ExecRestrictedSQL(ctx context.Context, sql string) (ast.Record } if len(rawStmts) != 1 { log.Errorf("ExecRestrictedSQL only executes one statement. Too many/few statement in %s", sql) - return nil, errors.New("Wrong number of statement.") + return nil, errors.New("wrong number of statement") } st, err := Compile(s, rawStmts[0]) if err != nil { diff --git a/store/localstore/local_region.go b/store/localstore/local_region.go index 7deda5257ba9f..f920c8f0b7220 100644 --- a/store/localstore/local_region.go +++ b/store/localstore/local_region.go @@ -212,7 +212,7 @@ func (rs *localRegion) Handle(req *regionRequest) (*regionResponse, error) { ctx.descScan = sel.OrderBy[0].Desc } else { if sel.Limit == nil { - return nil, errors.New("We don't support pushing down Sort without Limit.") + return nil, errors.New("we don't support pushing down Sort without Limit") } ctx.topn = true ctx.topnHeap = &topnHeap{