diff options
Diffstat (limited to 'vendor/github.com/uptrace/bun/model_map.go')
-rw-r--r-- | vendor/github.com/uptrace/bun/model_map.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vendor/github.com/uptrace/bun/model_map.go b/vendor/github.com/uptrace/bun/model_map.go index 814d636e6..d7342576f 100644 --- a/vendor/github.com/uptrace/bun/model_map.go +++ b/vendor/github.com/uptrace/bun/model_map.go @@ -1,6 +1,7 @@ package bun import ( + "bytes" "context" "database/sql" "reflect" @@ -82,6 +83,8 @@ func (m *mapModel) Scan(src interface{}) error { return m.scanRaw(src) case reflect.Slice: if scanType.Elem().Kind() == reflect.Uint8 { + // Reference types such as []byte are only valid until the next call to Scan. + src := bytes.Clone(src.([]byte)) return m.scanRaw(src) } } |