From e05ff0373b6c6a80c7d3f6e027339d5d777de56d Mon Sep 17 00:00:00 2001 From: Wenkai Yin Date: Mon, 13 Jun 2016 08:54:42 +0800 Subject: [PATCH] update implements of FilterTargets() --- dao/replication_job.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 }