Remove sql string's validation check

This commit is contained in:
Jinzhu 2014-04-30 11:53:00 +08:00
parent ddc1f9156a
commit 452123479e
2 changed files with 1 additions and 13 deletions

View File

@ -611,11 +611,6 @@ func TestSelect(t *testing.T) {
if user.Name != "3" { if user.Name != "3" {
t.Errorf("Should got Name = 3 when searching with it, %+v", user.Id) 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) { func TestOrderAndPluck(t *testing.T) {

View File

@ -1,9 +1,6 @@
package gorm package gorm
import ( import "strconv"
"regexp"
"strconv"
)
type search struct { type search struct {
db *DB db *DB
@ -140,9 +137,5 @@ func (s *search) getInterfaceAsSql(value interface{}) (str string) {
default: default:
s.db.err(InvalidSql) s.db.err(InvalidSql)
} }
if regexp.MustCompile(";").MatchString(str) {
s.db.err(InvalidSql)
}
return return
} }