diff --git a/dao/replication_job.go b/dao/replication_job.go index a07d2c66f..3e2d83a6a 100644 --- a/dao/replication_job.go +++ b/dao/replication_job.go @@ -68,10 +68,13 @@ func FilterRepTargets(name string) ([]*models.RepTarget, error) { } o := GetOrmer() + var args []string + args = append(args, "%"+name+"%") var targets []*models.RepTarget + sql := "select * from replication_target where name like ?" - if _, err := o.Raw(sql, "%"+name+"%").QueryRows(targets); err != nil { + if _, err := o.Raw(sql, args).QueryRows(targets); err != nil { return nil, err }