fix Interface2Interface *sql.RawBytes light copy bug

This commit is contained in:
hsfish 2023-03-15 19:18:50 +08:00
parent d485abba57
commit 926930b7c5
1 changed files with 4 additions and 2 deletions

View File

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