ddl: make added count correct in adding index (#6980)

This commit is contained in:
Lynn
2018-07-05 11:59:35 +08:00
committed by ciscoxll
parent 40193a3daf
commit bdfa5eef19

View File

@ -587,9 +587,9 @@ func (w *addIndexWorker) fetchRowColVals(txn kv.Transaction, taskRange reorgInde
// backfillIndexInTxn will add w.batchCnt indices once, default value of w.batchCnt is 128.
// TODO: make w.batchCnt can be modified by system variable.
func (w *addIndexWorker) backfillIndexInTxn(handleRange reorgIndexTask) (nextHandle int64, addedCount, scanCount int, errInTxn error) {
addedCount = 0
scanCount = 0
errInTxn = kv.RunInNewTxn(w.sessCtx.GetStore(), true, func(txn kv.Transaction) error {
addedCount = 0
scanCount = 0
txn.SetOption(kv.Priority, kv.PriorityLow)
idxRecords, handleOutOfRange, err := w.fetchRowColVals(txn, handleRange)
if err != nil {