解决Conversion接口ToDB() ([]byte, error)方法返回*Type值为nil时,数据类型为[]byte(nil)的bug,解决*Type值为nil时插入数据变为""的bug
This commit is contained in:
parent
6a1dd59737
commit
a23913685e
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue