diff --git a/scope_private.go b/scope_private.go index fa5d5f44..e7ea6699 100644 --- a/scope_private.go +++ b/scope_private.go @@ -21,7 +21,11 @@ func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str stri if regexp.MustCompile("^\\s*\\d+\\s*$").MatchString(value) { return scope.primaryCondition(scope.AddToVars(value)) } else if value != "" { - str = fmt.Sprintf("(%v)", value) + if regexp.MustCompile("^[a-zA-Z0-9]+$").MatchString(value) { + return scope.primaryCondition(scope.AddToVars(value)) + } else { + str = fmt.Sprintf("(%v)", value) + } } case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, sql.NullInt64: return scope.primaryCondition(scope.AddToVars(value))