Skip to content

Commit 0237595

Browse files
committed
fixup
1 parent 990de1d commit 0237595

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

serialization/serialization.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ func decodeVar(r io.ReadSeeker, unsigned bool) (interface{}, error) {
294294
tNum = binary.LittleEndian.Uint64(fieldBytes)
295295
}
296296
if unsigned {
297-
return (tNum >> (tb + 2) * 2) + 1, nil
297+
return tNum >> (tb + 1), nil
298298
}
299299
return int64(tNum >> (tb + 2)), nil
300300
}

serialization/serialization_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ func TestDecodeVar(t *testing.T) {
148148
int64(123),
149149
"",
150150
},
151-
// {
152-
// []byte{0xc3, 02, 0x0b},
153-
// true,
154-
// uint64(90200),
155-
// "",
156-
// },
151+
{
152+
[]byte{0xc3, 02, 0x0b},
153+
true,
154+
uint64(90200),
155+
"",
156+
},
157157
{
158158
// From the example on https://dev.mysql.com/doc/dev/mysql-server/latest/PageLibsMysqlSerialization.html
159159
// But converted to LE

0 commit comments

Comments
 (0)