Skip to content

Commit

Permalink
tracker(dm): fix downstream table structure reports key too long (#7014
Browse files Browse the repository at this point in the history
…) (#6686)

close #5315
  • Loading branch information
ti-chi-bot authored Sep 19, 2022
1 parent ca11f77 commit ed9ffce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions dm/pkg/schema/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ func NewTracker(ctx context.Context, task string, sessionCfg map[string]string,
// bypass wait time of https://github.com/pingcap/tidb/pull/20550
conf.TiKVClient.AsyncCommit.SafeWindow = 0
conf.TiKVClient.AsyncCommit.AllowedClockDrift = 0
// bypass "Specified key was too long"
conf.MaxIndexLength = 1<<32 - 1
})

if len(sessionCfg) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion dm/pkg/schema/tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ func (s *trackerSuite) TestVarchar20000(c *C) {

mock.ExpectQuery("SHOW CREATE TABLE " + tableID).WillReturnRows(
sqlmock.NewRows([]string{"Table", "Create Table"}).
AddRow("test", "create table t(c varchar(20000)) charset=utf8"))
AddRow("test", "create table t(c varchar(20000), key(c(20000))) charset=utf8"))
_, err = tracker.GetDownStreamTableInfo(tcontext.Background(), tableID, oriTi)
c.Assert(err, IsNil)
_, ok := tracker.dsTracker.tableInfos[tableID]
Expand Down

0 comments on commit ed9ffce

Please sign in to comment.