Skip to content

Commit

Permalink
revert more code
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunzhu committed Dec 30, 2021
1 parent 1168dc7 commit 435797d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 362 deletions.
14 changes: 3 additions & 11 deletions ddl/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import (
"sync/atomic"
"time"

"github.com/pingcap/tidb/ddl/sst"
util2 "github.com/pingcap/tidb/table/tables/util"
tableutil "github.com/pingcap/tidb/table/tables/util"

"github.com/pingcap/errors"
"github.com/pingcap/failpoint"
Expand Down Expand Up @@ -513,8 +512,6 @@ func (w *worker) onCreateIndex(d *ddlCtx, t *meta.Meta, job *model.Job, isPK boo
originalState := indexInfo.State
switch indexInfo.State {
case model.StateNone:
// TODO: optimize index-ddl
sst.PrepareIndexOp(w.ctx, sst.DDLInfo{job.SchemaName, tblInfo, job.RealStartTS})
// none -> delete only
indexInfo.State = model.StateDeleteOnly
updateHiddenColumns(tblInfo, indexInfo, model.StatePublic)
Expand Down Expand Up @@ -605,11 +602,6 @@ func (w *worker) onCreateIndex(d *ddlCtx, t *meta.Meta, job *model.Job, isPK boo
}
// Finish this job.
job.FinishTableJob(model.JobStateDone, model.StatePublic, ver, tblInfo)
// TODO: optimize index ddl.
err = sst.FinishIndexOp(w.ctx, job.StartTS)
if err != nil {
logutil.BgLogger().Error("FinishIndexOp err" + err.Error())
}
default:
err = ErrInvalidDDLState.GenWithStackByArgs("index", tblInfo.State)
}
Expand Down Expand Up @@ -1088,7 +1080,7 @@ func (w *baseIndexWorker) getIndexRecord(idxInfo *model.IndexInfo, handle kv.Han
idxVal[j] = idxColumnVal
continue
}
idxColumnVal, err = util2.GetColDefaultValue(w.sessCtx, col, w.defaultVals)
idxColumnVal, err = tableutil.GetColDefaultValue(w.sessCtx, col, w.defaultVals)
if err != nil {
return nil, errors.Trace(err)
}
Expand Down Expand Up @@ -1217,7 +1209,7 @@ func (w *addIndexWorker) checkHandleExists(key kv.Key, value []byte, handle kv.H
if hasBeenBackFilled {
return nil
}
colInfos := util2.BuildRowcodecColInfoForIndexColumns(idxInfo, tblInfo)
colInfos := tableutil.BuildRowcodecColInfoForIndexColumns(idxInfo, tblInfo)
values, err := tablecodec.DecodeIndexKV(key, value, idxColLen, tablecodec.HandleNotNeeded, colInfos)
if err != nil {
return err
Expand Down
105 changes: 0 additions & 105 deletions ddl/sst/common.go

This file was deleted.

4 changes: 0 additions & 4 deletions ddl/sst/glue/lightning_glue.go

This file was deleted.

234 changes: 0 additions & 234 deletions ddl/sst/index.go

This file was deleted.

Loading

0 comments on commit 435797d

Please sign in to comment.