Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: ailinkid <[email protected]>
  • Loading branch information
AilinKid committed Mar 3, 2021
1 parent 41683f0 commit 10737b5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ddl/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const (
completeDeleteRangeSQL = `DELETE FROM mysql.gc_delete_range WHERE job_id = %? AND element_id = %?`
updateDeleteRangeSQL = `UPDATE mysql.gc_delete_range SET start_key = %? WHERE job_id = %? AND element_id = %? AND start_key = %?`
deleteDoneRecordSQL = `DELETE FROM mysql.gc_delete_range_done WHERE job_id = %? AND element_id = %?`
loadGlobalVars = `SELECT HIGH_PRIORITY variable_name, variable_value from mysql.global_variables where variable_name in (` // + nameList + ")"
loadGlobalVars = `SELECT HIGH_PRIORITY variable_name, variable_value from mysql.global_variables where variable_name in (%?)`
)

// DelRangeTask is for run delete-range command in gc_worker.
Expand Down Expand Up @@ -155,8 +155,7 @@ func LoadDDLVars(ctx sessionctx.Context) error {
func LoadGlobalVars(ctx sessionctx.Context, varNames []string) error {
if sctx, ok := ctx.(sqlexec.RestrictedSQLExecutor); ok {
var buf strings.Builder
sqlexec.MustFormatSQL(&buf, loadGlobalVars)
sqlexec.MustFormatSQL(&buf, "%? )", varNames)
sqlexec.MustFormatSQL(&buf, loadGlobalVars, varNames)
rows, _, err := sctx.ExecRestrictedSQL(ctx, buf.String())
if err != nil {
return errors.Trace(err)
Expand Down

0 comments on commit 10737b5

Please sign in to comment.