Fix unicode chars in SQL

This commit is contained in:
Jinzhu 2018-02-13 12:37:39 +08:00
parent 67c4280c57
commit becd777b1e
1 changed files with 3 additions and 3 deletions

View File

@ -649,12 +649,12 @@ func (scope *Scope) buildCondition(clause map[string]interface{}, include bool)
buff := bytes.NewBuffer([]byte{})
i := 0
for pos := range str {
if str[pos] == '?' {
for _, s := range str {
if s == '?' {
buff.WriteString(replacements[i])
i++
} else {
buff.WriteByte(str[pos])
buff.WriteRune(s)
}
}