Skip to content

Commit

Permalink
style:fix ineffassign and mis-spell (pingcap#9415)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiekeyi98 authored and ngaut committed Feb 22, 2019
1 parent 0ee8899 commit 9b692c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions ddl/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2210,6 +2210,7 @@ func (s *testDBSuite) TestCheckConvertToCharacter(c *C) {
ctx := s.tk.Se.(sessionctx.Context)
is := domain.GetDomain(ctx).InfoSchema()
t, err := is.TableByName(model.NewCIStr("test"), model.NewCIStr("t"))
c.Assert(err, IsNil)
rs, err := s.tk.Exec("alter table t modify column a varchar(10) charset utf8 collate utf8_bin")
c.Assert(err, NotNil)
rs, err = s.tk.Exec("alter table t modify column a varchar(10) charset utf8mb4 collate utf8mb4_bin")
Expand Down
2 changes: 1 addition & 1 deletion ddl/ddl_algorithm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Loop:

// Test unsupported.
for _, alm := range unsupported {
algorithm, err = ddl.ResolveAlterAlgorithm(&tc.alterSpec, alm)
_, err = ddl.ResolveAlterAlgorithm(&tc.alterSpec, alm)
c.Assert(err, NotNil, Commentf("Tp:%v, alm:%s", tc.alterSpec.Tp, alm))
c.Assert(ddl.ErrAlterOperationNotSupported.Equal(err), IsTrue)
}
Expand Down
3 changes: 1 addition & 2 deletions ddl/ddl_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ func getCharsetAndCollateInTableOption(startIdx int, options []*ast.TableOption)
}

// resolveAlterTableSpec resolves alter table algorithm and removes ignore table spec in specs.
// returns valied specs, and the occured error.
// returns valied specs, and the occurred error.
func resolveAlterTableSpec(ctx sessionctx.Context, specs []*ast.AlterTableSpec) ([]*ast.AlterTableSpec, error) {
validSpecs := make([]*ast.AlterTableSpec, 0, len(specs))
algorithm := ast.AlterAlgorithmDefault
Expand Down Expand Up @@ -1469,7 +1469,6 @@ func resolveAlterTableSpec(ctx sessionctx.Context, specs []*ast.AlterTableSpec)
// For the compatibility, we return warning instead of error when the algorithm is COPY,
// because the COPY ALGORITHM is not supported in TiDB.
ctx.GetSessionVars().StmtCtx.AppendError(err)
err = nil
}

spec.Algorithm = resolvedAlgorithm
Expand Down

0 comments on commit 9b692c0

Please sign in to comment.