You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an issue when working with the bob library. It appears that the conversion of uint64 to int64 in the following code is causing problems when handling MySQL's unsigned bigint type (defined as bigint unsigned null):
// aarondl/optfuncToDriverValue(valany) (driver.Value, error) {
refVal:=reflect.ValueOf(val)
ifrefVal.Type().Implements(globaldata.DriverValuerIntf) {
valuer:=refVal.Interface().(driver.Valuer)
returnvaluer.Value()
}
// If it is of time.Time type, return it as is.ifrefVal.Type() ==globaldata.TimeType {
returnval, nil
}
// If it implements encoding.TextMarshaler, use that.ifrefVal.Type().Implements(globaldata.EncodingTextMarshalerIntf) {
marshaler:=refVal.Interface().(encoding.TextMarshaler)
returnmarshaler.MarshalText()
}
// If it implements encoding.BinaryMarshaler, use that.ifrefVal.Type().Implements(globaldata.EncodingBinaryMarshalerIntf) {
marshaler:=refVal.Interface().(encoding.BinaryMarshaler)
returnmarshaler.MarshalBinary()
}
switchrefVal.Kind() {
casereflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
returnrefVal.Int(), nilcasereflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
// Problem appears to originate from converting uint64 to int64.returnint64(refVal.Uint()), nilcasereflect.Float32, reflect.Float64:
returnrefVal.Float(), nilcasereflect.Bool:
returnrefVal.Bool(), nilcasereflect.Slice:
ifrefVal.Type().Elem().Kind() ==reflect.Uint8 {
returnrefVal.Bytes(), nil
}
casereflect.String:
returnrefVal.String(), nil
}
returnval, nil
}
Could you confirm if this behavior is indeed a bug? Additionally, is there a temporary workaround available to resolve the issue with unsigned bigint support?
Thanks for your help!
The text was updated successfully, but these errors were encountered:
Hi,
I've encountered an issue when working with the bob library. It appears that the conversion of uint64 to int64 in the following code is causing problems when handling MySQL's unsigned bigint type (defined as
bigint unsigned null
):Could you confirm if this behavior is indeed a bug? Additionally, is there a temporary workaround available to resolve the issue with unsigned bigint support?
Thanks for your help!
The text was updated successfully, but these errors were encountered: