Skip to content

Commit

Permalink
Remove sql string's validation check
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed Apr 30, 2014
1 parent ddc1f91 commit 4521234
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
5 changes: 0 additions & 5 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 1 addition & 8 deletions search.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package gorm

import (
"regexp"
"strconv"
)
import "strconv"

type search struct {
db *DB
Expand Down Expand Up @@ -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
}

0 comments on commit 4521234

Please sign in to comment.