Skip to content

Commit fb5a2a0

Browse files
author
elonnzhang
committed
fix bigint unsigned null cloumn scan to err type int64
1 parent 44553d6 commit fb5a2a0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fields.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ var (
128128
scanTypeInt64 = reflect.TypeOf(int64(0))
129129
scanTypeNullFloat = reflect.TypeOf(sql.NullFloat64{})
130130
scanTypeNullInt = reflect.TypeOf(sql.NullInt64{})
131+
scanTypeNullUInt = reflect.TypeOf(sql.Null[uint64]{})
131132
scanTypeNullTime = reflect.TypeOf(sql.NullTime{})
132133
scanTypeUint8 = reflect.TypeOf(uint8(0))
133134
scanTypeUint16 = reflect.TypeOf(uint16(0))
@@ -185,6 +186,9 @@ func (mf *mysqlField) scanType() reflect.Type {
185186
}
186187
return scanTypeInt64
187188
}
189+
if mf.flags&flagUnsigned != 0 {
190+
return scanTypeNullUInt
191+
}
188192
return scanTypeNullInt
189193

190194
case fieldTypeFloat:

0 commit comments

Comments
 (0)