mirror of https://github.com/go-gorm/gorm.git
Remove sql string's validation check
This commit is contained in:
parent
ddc1f9156a
commit
452123479e
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue