From 68b2dcd9af8c7ee3fdb2702fcd7a56a647db3fe7 Mon Sep 17 00:00:00 2001 From: meiji163 Date: Sun, 23 Nov 2025 15:28:26 -0800 Subject: [PATCH] escape table name in ReadLastCheckpoint --- go/logic/applier.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()),