reflect.Value.Bytes() should only be called when reflect.Value.Kind() is reflect.Slice, and not reflect.Array (#1346)

This commit is contained in:
Talha Ansari 2019-07-04 22:59:57 -04:00 committed by Lunny Xiao
parent 4c806608ab
commit 9016f95a15
1 changed files with 1 additions and 1 deletions

View File

@ -640,7 +640,7 @@ func (session *Session) value2Interface(col *core.Column, fieldValue reflect.Val
} else if col.SQLType.IsBlob() {
var bytes []byte
var err error
if (k == reflect.Array || k == reflect.Slice) &&
if (k == reflect.Slice) &&
(fieldValue.Type().Elem().Kind() == reflect.Uint8) {
bytes = fieldValue.Bytes()
} else {