diff --git a/go/logic/applier.go b/go/logic/applier.go index 3fe7f2287..347817d6f 100644 --- a/go/logic/applier.go +++ b/go/logic/applier.go @@ -637,7 +637,7 @@ func (this *Applier) WriteCheckpoint(chk *Checkpoint) (int64, error) { } func (this *Applier) ReadLastCheckpoint() (*Checkpoint, error) { - row := this.db.QueryRow(fmt.Sprintf(`select /* gh-ost */ * from %s.%s order by gh_ost_chk_id desc limit 1`, this.migrationContext.DatabaseName, this.migrationContext.GetCheckpointTableName())) + row := this.db.QueryRow(fmt.Sprintf(`select /* gh-ost */ * from %s.%s order by gh_ost_chk_id desc limit 1`, sql.EscapeName(this.migrationContext.DatabaseName), sql.EscapeName(this.migrationContext.GetCheckpointTableName()))) chk := &Checkpoint{ IterationRangeMin: sql.NewColumnValues(this.migrationContext.UniqueKey.Columns.Len()), IterationRangeMax: sql.NewColumnValues(this.migrationContext.UniqueKey.Columns.Len()),