func (d *ddl) dropTableIndex(indexInfo *model.IndexInfo, job *model.Job) error { startKey := tablecodec.EncodeTableIndexPrefix(job.TableID, indexInfo.ID) // It's asynchronous so it doesn't need to consider if it completes. deleteAll := -1 _, _, err := d.delKeysWithStartKey(startKey, startKey, ddlJobFlag, job, deleteAll) return errors.Trace(err) }
// NewIndex builds a new Index object. func NewIndex(tableInfo *model.TableInfo, indexInfo *model.IndexInfo) table.Index { index := &index{ tblInfo: tableInfo, idxInfo: indexInfo, prefix: kv.Key(tablecodec.EncodeTableIndexPrefix(tableInfo.ID, indexInfo.ID)), } return index }
func (d *ddl) dropTableIndex(t table.Table, indexInfo *model.IndexInfo) error { prefix := tablecodec.EncodeTableIndexPrefix(t.Meta().ID, indexInfo.ID) err := d.delKeysWithPrefix(prefix) return errors.Trace(err) }