Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jiyfhust committed Aug 3, 2023
1 parent 9967450 commit 47f36bd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ddl/backfilling.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,11 +547,21 @@ func getBatchTasks(t table.Table, reorgInfo *reorgInfo, kvRanges []kv.KeyRange,
taskID := taskIDAlloc.alloc()
startKey := keyRange.StartKey
if len(startKey) == 0 {
startKey = prefix
if reorgInfo.mergingTmpIdx {
startKey, _ = tablecodec.GetTableIndexKeyRange(reorgInfo.PhysicalTableID,
tablecodec.TempIndexPrefix|reorgInfo.elements[0].ID)
} else {
startKey = prefix
}
}
endKey := keyRange.EndKey
if len(endKey) == 0 {
endKey = prefix.PrefixNext()
if reorgInfo.mergingTmpIdx {
_, endKey = tablecodec.GetTableIndexKeyRange(reorgInfo.PhysicalTableID,
tablecodec.TempIndexPrefix|reorgInfo.elements[0].ID)
} else {
endKey = prefix.PrefixNext()
}
}
endK, err := getRangeEndKey(jobCtx, reorgInfo.d.store, job.Priority, prefix, startKey, endKey)
if err != nil {
Expand Down

0 comments on commit 47f36bd

Please sign in to comment.