Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Max index length (#220)
Browse files Browse the repository at this point in the history
* restore: set max-index-length to max

* restore:add max-index-length params

* address comment

* address comment
  • Loading branch information
3pointer authored Apr 2, 2020
1 parent 01de3f5 commit 3341f40
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/task/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/pingcap/log"
"github.com/pingcap/parser/model"
"github.com/pingcap/tidb-tools/pkg/filter"
"github.com/pingcap/tidb/config"
"github.com/spf13/pflag"
"go.uber.org/zap"

Expand Down Expand Up @@ -148,6 +149,15 @@ func RunRestore(c context.Context, g glue.Glue, cmdName string, cfg *RestoreConf
return err
}
// execute DDL first

// set max-index-length before execute DDLs and create tables
// we set this value to max(3072*4), otherwise we might not restore table
// when upstream and downstream both set this value greater than default(3072)
conf := config.GetGlobalConfig()
conf.MaxIndexLength = config.DefMaxOfMaxIndexLength
config.StoreGlobalConfig(conf)
log.Warn("set max-index-length to max(3072*4) to skip check index length in DDL")

err = client.ExecDDLs(ddlJobs)
if err != nil {
return errors.Trace(err)
Expand Down

0 comments on commit 3341f40

Please sign in to comment.