forked from mirror/gorm
Fix unicode chars in SQL
This commit is contained in:
parent
67c4280c57
commit
becd777b1e
6
scope.go
6
scope.go
|
@ -649,12 +649,12 @@ func (scope *Scope) buildCondition(clause map[string]interface{}, include bool)
|
||||||
|
|
||||||
buff := bytes.NewBuffer([]byte{})
|
buff := bytes.NewBuffer([]byte{})
|
||||||
i := 0
|
i := 0
|
||||||
for pos := range str {
|
for _, s := range str {
|
||||||
if str[pos] == '?' {
|
if s == '?' {
|
||||||
buff.WriteString(replacements[i])
|
buff.WriteString(replacements[i])
|
||||||
i++
|
i++
|
||||||
} else {
|
} else {
|
||||||
buff.WriteByte(str[pos])
|
buff.WriteRune(s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue