Skip to content

Commit

Permalink
*: add the error check (#8770) (#8806)
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala authored and ngaut committed Dec 25, 2018
1 parent 305a083 commit fcd6d7d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions ddl/ddl_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ func (s *testDDLSuite) TestCancelJob(c *C) {
Options: []*ast.ColumnOption{},
}
col, _, err := buildColumnAndConstraint(ctx, 2, newColumnDef)
c.Assert(err, IsNil)
addColumnArgs := []interface{}{col, &ast.ColumnPosition{Tp: ast.ColumnPositionNone}, 0}
doDDLJobErrWithSchemaState(ctx, d, c, dbInfo.ID, tblInfo.ID, model.ActionAddColumn, addColumnArgs, &cancelState)
c.Check(errors.ErrorStack(checkErr), Equals, "")
Expand Down
1 change: 0 additions & 1 deletion privilege/privileges/privileges_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ func (s *testPrivilegeSuite) TestShowGrants(c *C) {
c.Assert(err, IsNil)
// It should not be "GRANT ON `te%`.* to 'show'@'localhost'"
c.Assert(gs, HasLen, 0)

}

func (s *testPrivilegeSuite) TestDropTablePriv(c *C) {
Expand Down
1 change: 1 addition & 0 deletions store/tikv/gcworker/gc_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func (s *testGCWorkerSuite) TestPrepareGC(c *C) {
close(s.gcWorker.done)
ok, _, err := s.gcWorker.prepare()
c.Assert(err, IsNil)
c.Assert(ok, IsFalse)
lastRun, err := s.gcWorker.loadTime(gcLastRunTimeKey, s.gcWorker.session)
c.Assert(err, IsNil)
c.Assert(lastRun, NotNil)
Expand Down
4 changes: 2 additions & 2 deletions util/admin/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ func (s *testSuite) TestScan(c *C) {
idxRow2 := &RecordData{Handle: int64(2), Values: types.MakeDatums(int64(20))}
kvIndex := tables.NewIndex(tb.Meta(), indices[0].Meta())
sc := &stmtctx.StatementContext{TimeZone: time.Local}
idxRows, nextVals, err := ScanIndexData(sc, txn, kvIndex, idxRow1.Values, 2)
idxRows, _, err := ScanIndexData(sc, txn, kvIndex, idxRow1.Values, 2)
c.Assert(err, IsNil)
c.Assert(idxRows, DeepEquals, []*RecordData{idxRow1, idxRow2})
idxRows, nextVals, err = ScanIndexData(sc, txn, kvIndex, idxRow1.Values, 1)
idxRows, nextVals, err := ScanIndexData(sc, txn, kvIndex, idxRow1.Values, 1)
c.Assert(err, IsNil)
c.Assert(idxRows, DeepEquals, []*RecordData{idxRow1})
idxRows, nextVals, err = ScanIndexData(sc, txn, kvIndex, nextVals, 1)
Expand Down
2 changes: 1 addition & 1 deletion util/ranger/detacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func DetachSimpleCondAndBuildRangeForIndex(sctx sessionctx.Context, conditions [
newTpSlice = append(newTpSlice, newFieldType(col.RetType))
}
ranges, accessConds, _, _, err = detachCNFCondAndBuildRangeForIndex(sctx, conditions, cols, newTpSlice, lengths, false)
return ranges, accessConds, nil
return ranges, accessConds, errors.Trace(err)
}

func removeAccessConditions(conditions, accessConds []expression.Expression) []expression.Expression {
Expand Down

0 comments on commit fcd6d7d

Please sign in to comment.