Merge pull request #142 from NicolasSamDuval/master
Support uint64 with high bit set.
This commit is contained in:
commit
5f8a20eb1c
|
@ -2597,6 +2597,8 @@ func (session *Session) value2Interface(col *core.Column, fieldValue reflect.Val
|
|||
} else {
|
||||
return nil, ErrUnSupportedType
|
||||
}
|
||||
case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
|
||||
return int64(fieldValue.Uint()), nil
|
||||
default:
|
||||
return fieldValue.Interface(), nil
|
||||
}
|
||||
|
|
|
@ -375,7 +375,8 @@ func buildUpdates(engine *Engine, table *core.Table, bean interface{},
|
|||
if !requiredField && fieldValue.Uint() == 0 {
|
||||
continue
|
||||
}
|
||||
val = fieldValue.Interface()
|
||||
t := int64(fieldValue.Uint())
|
||||
val = reflect.ValueOf(&t).Interface()
|
||||
case reflect.Struct:
|
||||
if fieldType == reflect.TypeOf(time.Now()) {
|
||||
t := fieldValue.Interface().(time.Time)
|
||||
|
@ -546,7 +547,8 @@ func buildConditions(engine *Engine, table *core.Table, bean interface{},
|
|||
if !requiredField && fieldValue.Uint() == 0 {
|
||||
continue
|
||||
}
|
||||
val = fieldValue.Interface()
|
||||
t := int64(fieldValue.Uint())
|
||||
val = reflect.ValueOf(&t).Interface()
|
||||
case reflect.Struct:
|
||||
if fieldType == reflect.TypeOf(time.Now()) {
|
||||
t := fieldValue.Interface().(time.Time)
|
||||
|
|
Loading…
Reference in New Issue