diff --git a/AUTHORS b/AUTHORS index a3839579..c5293e0f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -126,6 +126,7 @@ Zhang Xiang Zhenye Xie Zhixin Wen Ziheng Lyu +Jiabin Zhang # Organizations diff --git a/fields.go b/fields.go index be5cd809..25a16628 100644 --- a/fields.go +++ b/fields.go @@ -128,6 +128,7 @@ var ( scanTypeInt64 = reflect.TypeOf(int64(0)) scanTypeNullFloat = reflect.TypeOf(sql.NullFloat64{}) scanTypeNullInt = reflect.TypeOf(sql.NullInt64{}) + scanTypeNullUint = reflect.TypeOf(sql.Null[uint64]{}) scanTypeNullTime = reflect.TypeOf(sql.NullTime{}) scanTypeUint8 = reflect.TypeOf(uint8(0)) scanTypeUint16 = reflect.TypeOf(uint16(0)) @@ -185,6 +186,9 @@ func (mf *mysqlField) scanType() reflect.Type { } return scanTypeInt64 } + if mf.flags&flagUnsigned != 0 { + return scanTypeNullUint + } return scanTypeNullInt case fieldTypeFloat: