Skip to content

Commit 215dee4

Browse files
authored
escape table name in ReadLastCheckpoint (#1610)
1 parent 1b7933a commit 215dee4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/logic/applier.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ func (this *Applier) WriteCheckpoint(chk *Checkpoint) (int64, error) {
637637
}
638638

639639
func (this *Applier) ReadLastCheckpoint() (*Checkpoint, error) {
640-
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()))
640+
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())))
641641
chk := &Checkpoint{
642642
IterationRangeMin: sql.NewColumnValues(this.migrationContext.UniqueKey.Columns.Len()),
643643
IterationRangeMax: sql.NewColumnValues(this.migrationContext.UniqueKey.Columns.Len()),

0 commit comments

Comments
 (0)