Skip to content

Commit

Permalink
Merge branch 'release-2.1' into local-inject-2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
AilinKid authored Mar 5, 2021
2 parents ea10d52 + 3d7da99 commit 7e528d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ddl/delete_range.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package ddl

import (
"encoding/hex"
"fmt"
"math"
"sync"

Expand All @@ -33,7 +32,7 @@ import (
)

const (
insertDeleteRangeSQL = `INSERT IGNORE INTO mysql.gc_delete_range VALUES ("%d", "%d", "%s", "%s", "%d")`
insertDeleteRangeSQL = `INSERT IGNORE INTO mysql.gc_delete_range VALUES (%?, %?, %?, %?, %?)`

delBatchSize = 65536
delBackLog = 128
Expand Down Expand Up @@ -302,8 +301,11 @@ func doInsert(s sqlexec.SQLExecutor, jobID int64, elementID int64, startKey, end
logutil.Logger(ddlLogCtx).Info("[ddl] insert into delete-range table", zap.Int64("jobID", jobID), zap.Int64("elementID", elementID))
startKeyEncoded := hex.EncodeToString(startKey)
endKeyEncoded := hex.EncodeToString(endKey)
sql := fmt.Sprintf(insertDeleteRangeSQL, jobID, elementID, startKeyEncoded, endKeyEncoded, ts)
_, err := s.Execute(context.Background(), sql)
sql, err := sqlexec.EscapeSQL(insertDeleteRangeSQL, jobID, elementID, startKeyEncoded, endKeyEncoded, ts)
if err != nil {
return err
}
_, err = s.Execute(context.Background(), sql)
return errors.Trace(err)
}

Expand Down

0 comments on commit 7e528d1

Please sign in to comment.