Skip to content

Commit

Permalink
Fix typos (pingcap#1714)
Browse files Browse the repository at this point in the history
  • Loading branch information
overvenus authored and shenli committed Sep 9, 2016
1 parent 099e8a9 commit 6dec141
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion evaluator/builtin_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func compareFuncFactory(op opcode.Op) BuiltinFunc {
case opcode.NE:
result = n != 0
default:
return d, ErrInvalidOperation.Gen("invalid op %v in comparision operation", op)
return d, ErrInvalidOperation.Gen("invalid op %v in comparison operation", op)
}
if result {
d.SetInt64(oneI64)
Expand Down
4 changes: 2 additions & 2 deletions evaluator/evaluator_binop.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (e *Evaluator) handleLogicOperation(o *ast.BinaryOperationExpr) bool {
case opcode.LogicXor:
return e.handleXor(o)
default:
e.err = ErrInvalidOperation.Gen("unkown operator %s", o.Op)
e.err = ErrInvalidOperation.Gen("unknown operator %s", o.Op)
return false
}
}
Expand Down Expand Up @@ -207,7 +207,7 @@ func getCompResult(op opcode.Op, value int) (bool, error) {
case opcode.NullEQ:
return value == 0, nil
default:
return false, ErrInvalidOperation.Gen("invalid op %v in comparision operation", op)
return false, ErrInvalidOperation.Gen("invalid op %v in comparison operation", op)
}
}

Expand Down
2 changes: 1 addition & 1 deletion executor/prepared.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (e *ExecuteExec) Build() error {
// if this time it failed, the real reason for the error is schema changed.
err := plan.PrepareStmt(e.IS, e.Ctx, prepared.Stmt)
if err != nil {
return ErrSchemaChanged.Gen("Schema change casued error: %s", err.Error())
return ErrSchemaChanged.Gen("Schema change caused error: %s", err.Error())
}
prepared.SchemaVersion = e.IS.SchemaMetaVersion()
}
Expand Down
4 changes: 2 additions & 2 deletions infoschema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ var columnsCols = []columnInfo{
{"IS_NULLABLE", mysql.TypeVarchar, 3, 0, nil, nil},
{"DATA_TYPE", mysql.TypeVarchar, 64, 0, nil, nil},
{"CHARACTER_MAXIMUM_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil},
{"CHARACTOR_OCTET_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil},
{"CHARACTER_OCTET_LENGTH", mysql.TypeLonglong, 21, 0, nil, nil},
{"NUMERIC_PRECISION", mysql.TypeLonglong, 21, 0, nil, nil},
{"NUMERIC_SCALE", mysql.TypeLonglong, 21, 0, nil, nil},
{"DATETIME_PRECISION", mysql.TypeLonglong, 21, 0, nil, nil},
Expand Down Expand Up @@ -391,7 +391,7 @@ func dataForColumnsInTable(schema *model.DBInfo, tbl *model.TableInfo) [][]types
columnDesc.Null, // IS_NULLABLE
types.TypeToStr(col.Tp, col.Charset), // DATA_TYPE
colLen, // CHARACTER_MAXIMUM_LENGTH
colLen, // CHARACTOR_OCTET_LENGTH
colLen, // CHARACTER_OCTET_LENGTH
decimal, // NUMERIC_PRECISION
0, // NUMERIC_SCALE
0, // DATETIME_PRECISION
Expand Down
2 changes: 1 addition & 1 deletion mysql/errname.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ var MySQLErrName = map[uint16]string{
ErrBinlogPurgeEmFile: "Too many files opened, please execute the command again",
ErrEventCannotCreateInThePast: "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.",
ErrEventCannotAlterInThePast: "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the future.",
ErrSlaveIncident: "The incident %s occured on the master. Message: %-.64s",
ErrSlaveIncident: "The incident %s occurred on the master. Message: %-.64s",
ErrNoPartitionForGivenValueSilent: "Table has no partition for some existing values",
ErrBinlogUnsafeStatement: "Unsafe statement written to the binary log using statement format since BINLOGFORMAT = STATEMENT. %s",
ErrSlaveFatal: "Fatal : %s",
Expand Down
8 changes: 4 additions & 4 deletions mysql/mydecimal.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func add(a, b, carry int32) (int32, int32) {
return sum, carry
}

// sub substracts b and carry from a, returns the diff and new carry.
// sub subtracts b and carry from a, returns the diff and new carry.
func sub(a, b, carry int32) (int32, int32) {
diff := a - b - carry
if diff < 0 {
Expand All @@ -84,7 +84,7 @@ func sub(a, b, carry int32) (int32, int32) {
return diff, carry
}

// sub2 substracts b and carry from a, returns the diff and new carry.
// sub2 subtracts b and carry from a, returns the diff and new carry.
// the new carry may be 2.
func sub2(a, b, carry int32) (int32, int32) {
diff := a - b - carry
Expand Down Expand Up @@ -575,15 +575,15 @@ func (d *MyDecimal) digitBounds() (start, end int) {
bufLen := digitsToWords(int(d.digitsInt)) + digitsToWords(int(d.digitsFrac))
bufEnd := bufLen - 1

/* find non-zero digit from number begining */
/* find non-zero digit from number beginning */
for bufBeg < bufLen && d.wordBuf[bufBeg] == 0 {
bufBeg++
}
if bufBeg >= bufLen {
return 0, 0
}

/* find non-zero decimal digit from number begining */
/* find non-zero decimal digit from number beginning */
if bufBeg == 0 && d.digitsInt > 0 {
i = (int(d.digitsInt) - 1) % digitsPerWord
start = digitsPerWord - i - 1
Expand Down
2 changes: 1 addition & 1 deletion parser/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ import (
BeginTransactionStmt "BEGIN TRANSACTION statement"
BinlogStmt "Binlog base64 statement"
CastType "Cast function target type"
CharsetName "Charactor set name"
CharsetName "Character set name"
ColumnDef "table column definition"
ColumnName "column name"
ColumnNameList "column name list"
Expand Down
2 changes: 1 addition & 1 deletion parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ func (s *testParserSuite) TestDDL(c *C) {
{"create schema xxx", true},
{"create schema if exists xxx", false},
{"create schema if not exists xxx", true},
// For drop datbase/schema/table
// For drop database/schema/table
{"drop database xxx", true},
{"drop database if exists xxx", true},
{"drop database if not exists xxx", false},
Expand Down
2 changes: 1 addition & 1 deletion plan/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ func (nr *nameResolver) resolveColumnNameInOnCondition(cn *ast.ColumnNameExpr) {
join := ctx.joinNodeStack[len(ctx.joinNodeStack)-1]
tableSources := appendTableSources(nil, join)
if !nr.resolveColumnInTableSources(cn, tableSources) {
nr.Err = errors.Errorf("unkown column name %s", cn.Name.Name.O)
nr.Err = errors.Errorf("unknown column name %s", cn.Name.Name.O)
}
}

Expand Down
2 changes: 1 addition & 1 deletion sessionctx/variable/sysvar.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ var SetNamesVariables = []string{
const (
// CollationConnection is the name for collation_connection system variable.
CollationConnection = "collation_connection"
// CharsetDatabase is the name for charactor_set_database system variable.
// CharsetDatabase is the name for character_set_database system variable.
CharsetDatabase = "character_set_database"
// CollationDatabase is the name for collation_database system variable.
CollationDatabase = "collation_database"
Expand Down
2 changes: 1 addition & 1 deletion store/localstore/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func (s *dbStore) unLockKeys(txn *dbTxn) error {
for k := range txn.lockedKeys {
if tid, ok := s.keysLocked[k]; !ok || tid != txn.tid {
debug.PrintStack()
return errors.Errorf("should never happend:%v, %v", tid, txn.tid)
return errors.Errorf("should never happened:%v, %v", tid, txn.tid)
}

delete(s.keysLocked, k)
Expand Down
2 changes: 1 addition & 1 deletion store/tikv/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func closeRequest(conn net.Conn, c *C) {
c.Assert(err, IsNil)
}

// Server close connection directly if new connection is comming.
// Server close connection directly if new connection is coming.
func (s *testClientSuite) TestRetryClose(c *C) {
l := startServer(":61235", c, closeRequest)
defer l.Close()
Expand Down
6 changes: 3 additions & 3 deletions store/tikv/lock_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ func (lr *LockResolver) getResolved(txnID uint64) (txnStatus, bool) {

// ResolveLocks tries to resolve Locks. The resolving process is in 3 steps:
// 1) Use the `lockTTL` to pick up all expired locks. Only locks that are too
// old are considerd orphan locks and will be handled later. If all locks are
// expired then all locks will be resolved so the returned `ok` will be true,
// otherwise caller should sleep a while before retry.
// old are considered orphan locks and will be handled later. If all locks
// are expired then all locks will be resolved so the returned `ok` will be
// true, otherwise caller should sleep a while before retry.
// 2) For each lock, query the primary key to get txn(which left the lock)'s
// commit status.
// 3) Send `ResolveLock` cmd to the lock's region to resolve all locks belong to
Expand Down
6 changes: 3 additions & 3 deletions util/types/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ func (s *testTypeConvertSuite) TestConvert(c *C) {

func (s *testTypeConvertSuite) TestGetValidFloat(c *C) {
cases := []struct {
orgin string
valid string
origin string
valid string
}{
{"-100", "-100"},
{"1abc", "1"},
Expand All @@ -530,6 +530,6 @@ func (s *testTypeConvertSuite) TestGetValidFloat(c *C) {
{"1.1e-13a", "1.1e-13"},
}
for _, ca := range cases {
c.Assert(getValidFloatPrefix(ca.orgin), Equals, ca.valid)
c.Assert(getValidFloatPrefix(ca.origin), Equals, ca.valid)
}
}

0 comments on commit 6dec141

Please sign in to comment.