mirror of https://github.com/go-gorm/gorm.git
Only mark those SQL strings has as invalid SQL
This commit is contained in:
parent
3264b82368
commit
a16a5fca58
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue