diff --git a/main_test.go b/main_test.go index 7cd7c211..7f7321f5 100644 --- a/main_test.go +++ b/main_test.go @@ -611,11 +611,6 @@ func TestSelect(t *testing.T) { if user.Name != "3" { t.Errorf("Should got Name = 3 when searching with it, %+v", user.Id) } - - query := db.Where("name = ?", "3").Select("nam;e") - if query.Error == nil { - t.Errorf("Should got error with invalid select string") - } } func TestOrderAndPluck(t *testing.T) { diff --git a/search.go b/search.go index bbc28131..44171365 100644 --- a/search.go +++ b/search.go @@ -1,9 +1,6 @@ package gorm -import ( - "regexp" - "strconv" -) +import "strconv" type search struct { db *DB @@ -140,9 +137,5 @@ func (s *search) getInterfaceAsSql(value interface{}) (str string) { default: s.db.err(InvalidSql) } - - if regexp.MustCompile(";").MatchString(str) { - s.db.err(InvalidSql) - } return }