Skip to content

Commit

Permalink
ddl: adjust table split. (pingcap#4926)
Browse files Browse the repository at this point in the history
  • Loading branch information
disksing authored Nov 1, 2017
1 parent ba9b1f7 commit ec5955d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
4 changes: 0 additions & 4 deletions ddl/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,6 @@ func (d *ddl) splitTableRegion(tableID int64) error {
if err := store.SplitRegion(tableStartKey); err != nil {
return errors.Trace(err)
}
nextTableStartKey := tablecodec.GenTablePrefix(tableID + 1)
if err := store.SplitRegion(nextTableStartKey); err != nil {
return errors.Trace(err)
}
return nil
}

Expand Down
2 changes: 0 additions & 2 deletions ddl/table_split_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func (s *testDDLTableSplitSuite) TestTableSplit(c *C) {
t, err := infoSchema.TableByName(model.NewCIStr("mysql"), model.NewCIStr("tidb"))
c.Assert(err, IsNil)
regionStartKey := tablecodec.EncodeTablePrefix(t.Meta().ID)
regionEndKey := tablecodec.EncodeTablePrefix(t.Meta().ID + 1)

type kvStore interface {
GetRegionCache() *tikv.RegionCache
Expand All @@ -50,5 +49,4 @@ func (s *testDDLTableSplitSuite) TestTableSplit(c *C) {
loc, err := cache.LocateKey(tikv.NewBackoffer(5000, context.Background()), regionStartKey)
c.Assert(err, IsNil)
c.Assert(loc.StartKey, BytesEquals, []byte(regionStartKey))
c.Assert(loc.EndKey, BytesEquals, []byte(regionEndKey))
}

0 comments on commit ec5955d

Please sign in to comment.