From a16a5fca589861843f17dd23557f505e1db98e8d Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 29 Apr 2014 15:51:49 +0800 Subject: [PATCH] Only mark those SQL strings has as invalid SQL --- search.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/search.go b/search.go index ec47bee2..bbc28131 100644 --- a/search.go +++ b/search.go @@ -141,8 +141,7 @@ func (s *search) getInterfaceAsSql(value interface{}) (str string) { s.db.err(InvalidSql) } - // Support field name with and without double quotes (useful when a field has a sql reserved word name) - if !regexp.MustCompile("^(\\s*\"[\\w\\s,.*\\+\\-()]*\"\\s*)$|^(\\s*\"?[\\w\\s,.*\\+\\-()]*\"?\\s*)$").MatchString(str) { + if regexp.MustCompile(";").MatchString(str) { s.db.err(InvalidSql) } return