diff --git a/session_convert.go b/session_convert.go index caff5d262..f43e12e07 100644 --- a/session_convert.go +++ b/session_convert.go @@ -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 } diff --git a/statement.go b/statement.go index 585378a8b..f2ece73dd 100644 --- a/statement.go +++ b/statement.go @@ -318,7 +318,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 }