解决Conversion接口ToDB() ([]byte, error)方法返回*Type值为nil时,数据类型为[]byte(nil)的bug,解决*Type值为nil时插入数据变为""的bug

This commit is contained in:
peihexian 2019-05-08 11:26:36 +08:00
parent 6a1dd59737
commit a23913685e
2 changed files with 8 additions and 1 deletions

View File

@ -554,6 +554,9 @@ func (session *Session) value2Interface(col *core.Column, fieldValue reflect.Val
if col.SQLType.IsBlob() {
return data, nil
}
if nil==data {
return nil,nil
}
return string(data), nil
}

View File

@ -319,7 +319,11 @@ func (statement *Statement) buildUpdates(bean interface{},
if err != nil {
engine.logger.Error(err)
} else {
val = data
if nil==data {
val=nil
}else{
val = data
}
}
goto APPEND
}