replace retval of ToDB with {}interface(nil)
instead of []byte(nil)
This commit is contained in:
parent
ad69f7d8f0
commit
19b206912e
|
@ -541,6 +541,9 @@ func (session *Session) value2Interface(col *core.Column, fieldValue reflect.Val
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
if col.SQLType.IsBlob() {
|
if col.SQLType.IsBlob() {
|
||||||
|
if data == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
return data, nil
|
return data, nil
|
||||||
}
|
}
|
||||||
return string(data), nil
|
return string(data), nil
|
||||||
|
@ -553,6 +556,9 @@ func (session *Session) value2Interface(col *core.Column, fieldValue reflect.Val
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
if col.SQLType.IsBlob() {
|
if col.SQLType.IsBlob() {
|
||||||
|
if data == nil {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
return data, nil
|
return data, nil
|
||||||
}
|
}
|
||||||
return string(data), nil
|
return string(data), nil
|
||||||
|
|
|
@ -305,8 +305,10 @@ func (statement *Statement) buildUpdates(bean interface{},
|
||||||
if err != nil {
|
if err != nil {
|
||||||
engine.logger.Error(err)
|
engine.logger.Error(err)
|
||||||
} else {
|
} else {
|
||||||
|
if data != nil {
|
||||||
val = data
|
val = data
|
||||||
}
|
}
|
||||||
|
}
|
||||||
goto APPEND
|
goto APPEND
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -316,8 +318,10 @@ func (statement *Statement) buildUpdates(bean interface{},
|
||||||
if err != nil {
|
if err != nil {
|
||||||
engine.logger.Error(err)
|
engine.logger.Error(err)
|
||||||
} else {
|
} else {
|
||||||
|
if data != nil {
|
||||||
val = data
|
val = data
|
||||||
}
|
}
|
||||||
|
}
|
||||||
goto APPEND
|
goto APPEND
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue