Fix issue with byte representation in MSSQL (#1957)

There is a missing cast to string in BuildUpdates which leads to a failure
to call str2ucs and ucs2str for converts on MSSQL.

Ref: https://github.com/go-gitea/gitea/issues/16252

Signed-off-by: Andrew Thornton <art27@cantab.net>

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1957
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-committed-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
Andrew Thornton 2021-07-23 09:01:49 +08:00 committed by Lunny Xiao
parent ad4830f531
commit d973423802
1 changed files with 6 additions and 0 deletions

View File

@ -129,6 +129,9 @@ func (statement *Statement) BuildUpdates(tableValue reflect.Value,
} }
if data != nil { if data != nil {
val = data val = data
if !col.SQLType.IsBlob() {
val = string(data)
}
} }
goto APPEND goto APPEND
} }
@ -141,6 +144,9 @@ func (statement *Statement) BuildUpdates(tableValue reflect.Value,
} }
if data != nil { if data != nil {
val = data val = data
if !col.SQLType.IsBlob() {
val = string(data)
}
} }
goto APPEND goto APPEND
} }