Skip to content

Commit

Permalink
*: fix misspells (pingcap#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
disksing committed Apr 22, 2016
1 parent f8d3022 commit d78e404
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion evaluator/evaluator_binop.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ func computeMul(a, b types.Datum) (d types.Datum, err error) {
}

func computeDiv(a, b types.Datum) (d types.Datum, err error) {
// MySQL support integer divison Div and division operator /
// MySQL support integer division Div and division operator /
// we use opcode.Div for division operator and will use another for integer division later.
// for division operator, we will use float64 for calculation.
switch a.Kind() {
Expand Down
6 changes: 3 additions & 3 deletions mysql/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func parseDateFormat(format string) []string {
start := 0
seps := []string{}
for i := 0; i < len(format); i++ {
// Date fromat must start and end with number.
// Date format must start and end with number.
if i == 0 || i == len(format)-1 {
if !unicode.IsNumber(rune(format[i])) {
return nil
Expand All @@ -351,7 +351,7 @@ func parseDateFormat(format string) []string {
continue
}

// Seperator is a single none-number char.
// Separator is a single none-number char.
if !unicode.IsNumber(rune(format[i])) {
if !unicode.IsNumber(rune(format[i-1])) {
return nil
Expand Down Expand Up @@ -938,7 +938,7 @@ func parseDateTimeFromNum(num int64) (Time, error) {
// Type is TypeDatetime, TypeTimestamp and TypeDate.
// Fsp is in range [0, 6].
// MySQL supports many valid datatime format, but still has some limitation.
// If delimiter exists, the date part and time part is seperated by a space or T,
// If delimiter exists, the date part and time part is separated by a space or T,
// other punctuation character can be used as the delimiter between date parts or time parts.
// If no delimiter, the format must be YYYYMMDDHHMMSS or YYMMDDHHMMSS
// If we have fractional seconds part, we must use decimal points as the delimiter.
Expand Down
2 changes: 1 addition & 1 deletion optimizer/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type resolverContext struct {
// When visiting TableRefs, tables in this context are not available
// because it is being collected.
inTableRefs bool
// When visiting on conditon only tables in current join node are available.
// When visiting on condition only tables in current join node are available.
inOnCondition bool
// When visiting field list, fieldList in this context are not available.
inFieldList bool
Expand Down
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const unlimitedRetryCnt = -1

type session struct {
txn kv.Transaction // Current transaction
args []interface{} // Statment execution args, this should be cleaned up after exec
args []interface{} // Statement execution args, this should be cleaned up after exec
values map[fmt.Stringer]interface{}
store kv.Storage
sid int64
Expand Down
4 changes: 2 additions & 2 deletions sessionctx/variable/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const codeCantGetValidID terror.ErrCode = 1

var errCantGetValidID = terror.ClassVariable.New(codeCantGetValidID, "cannot get valid auto-increment id in retry")

// RetryInfo saves retry infomation.
// RetryInfo saves retry information.
type RetryInfo struct {
Retrying bool
currRetryOff int
Expand Down Expand Up @@ -70,7 +70,7 @@ type SessionVars struct {
// prepared statement auto increment id
preparedStmtID uint32

// retry infomation
// retry information
RetryInfo *RetryInfo

// following variables are special for current session
Expand Down
2 changes: 1 addition & 1 deletion tidb-server/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (s *Server) releaseToken(token *Token) {
s.concurrentLimiter.Put(token)
}

// Generate a random string using ASCII characters but avoid seperator character.
// Generate a random string using ASCII characters but avoid separator character.
// See: https://github.com/mysql/mysql-server/blob/5.7/mysys_ssl/crypt_genhash_impl.cc#L435
func randomBuf(size int) []byte {
buf := make([]byte, size)
Expand Down
2 changes: 1 addition & 1 deletion util/charset/charset.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func GetAllCharsets() []*Desc {
}

// ValidCharsetAndCollation checks the charset and the collation validity
// and retuns a boolean.
// and returns a boolean.
func ValidCharsetAndCollation(cs string, co string) bool {
// We will use utf8 as a default charset.
if cs == "" {
Expand Down
2 changes: 1 addition & 1 deletion util/sqlexec/restricted_sql_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
// And in the same time, we do not want this interface becomes a general way to run sql statement.
// We hope this could be used with some restrictions such as only allowing system tables as target,
// do not allowing recursion call.
// For more infomation please refer to the comments in session.ExecRestrictedSQL().
// For more information please refer to the comments in session.ExecRestrictedSQL().
// This is implemented in session.go.
type RestrictedSQLExecutor interface {
// ExecRestrictedSQL run sql statement in ctx with some restriction.
Expand Down
2 changes: 1 addition & 1 deletion util/testkit/testkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func RowsWithSep(sep string, args ...string) [][]interface{} {
return rows
}

// Rows is similar to RowsWithSep, use white space as seperator string.
// Rows is similar to RowsWithSep, use white space as separator string.
func Rows(args ...string) [][]interface{} {
return RowsWithSep(" ", args...)
}
2 changes: 1 addition & 1 deletion util/types/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/pingcap/tidb/mysql"
)

// InvConv returns a failed convertion error.
// InvConv returns a failed conversion error.
func invConv(val interface{}, tp byte) (interface{}, error) {
return nil, errors.Errorf("cannot convert %v (type %T) to type %s", val, val, TypeStr(tp))
}
Expand Down
8 changes: 4 additions & 4 deletions util/types/overflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ func AddInteger(a uint64, b int64) (uint64, error) {
return a - uint64(-b), nil
}

// SubUint64 substracts uint64 a with b and returns uint64 if no overflow error.
// SubUint64 subtracts uint64 a with b and returns uint64 if no overflow error.
func SubUint64(a uint64, b uint64) (uint64, error) {
if a < b {
return 0, errors.Trace(ErrArithOverflow)
}
return a - b, nil
}

// SubInt64 substracts int64 a with b and returns int64 if no overflow error.
// SubInt64 subtracts int64 a with b and returns int64 if no overflow error.
func SubInt64(a int64, b int64) (int64, error) {
if (a > 0 && b < 0 && math.MaxInt64-a < -b) ||
(a < 0 && b > 0 && math.MinInt64-a > -b) ||
Expand All @@ -70,15 +70,15 @@ func SubInt64(a int64, b int64) (int64, error) {
return a - b, nil
}

// SubUintWithInt substracts uint64 a with int64 b and returns uint64 if no overflow error.
// SubUintWithInt subtracts uint64 a with int64 b and returns uint64 if no overflow error.
func SubUintWithInt(a uint64, b int64) (uint64, error) {
if b < 0 {
return AddUint64(a, uint64(-b))
}
return SubUint64(a, uint64(b))
}

// SubIntWithUint substracts int64 a with uint64 b and returns uint64 if no overflow error.
// SubIntWithUint subtracts int64 a with uint64 b and returns uint64 if no overflow error.
func SubIntWithUint(a int64, b uint64) (uint64, error) {
if a < 0 || uint64(a) < b {
return 0, errors.Trace(ErrArithOverflow)
Expand Down

0 comments on commit d78e404

Please sign in to comment.