fix(convert/interface.go): fix issue https://gitea.com/xorm/xorm/issues/2273

This commit is contained in:
Bingjia Chen 2023-06-08 11:57:10 +08:00
parent caa8a029c6
commit 2db28fd5d8
1 changed files with 4 additions and 1 deletions

View File

@ -24,7 +24,10 @@ func Interface2Interface(userLocation *time.Location, v interface{}) (interface{
return vv.String, nil return vv.String, nil
case *sql.RawBytes: case *sql.RawBytes:
if len([]byte(*vv)) > 0 { if len([]byte(*vv)) > 0 {
return []byte(*vv), nil src := []byte(*vv)
dest := make([]byte, len(src))
copy(dest, src)
return dest, nil
} }
return nil, nil return nil, nil
case *sql.NullInt32: case *sql.NullInt32: