We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ee187d commit 5399994Copy full SHA for 5399994
mysql/mysql_test.go
@@ -223,3 +223,9 @@ func (t *mysqlTestSuite) TestMysqlUUIDClone(c *check.C) {
223
clone := us.Clone()
224
c.Assert(clone.String(), check.Equals, "de278ad0-2106-11e4-9f8e-6edd0ca20947:1-2")
225
}
226
+
227
+func (t *mysqlTestSuite) TestMysqlEmptyDecode(c *check.C) {
228
+ _, isNull, n := LengthEncodedInt(nil)
229
+ c.Assert(isNull, check.IsTrue)
230
+ c.Assert(n, check.Equals, 0)
231
+}
mysql/util.go
@@ -142,7 +142,7 @@ func BFixedLengthInt(buf []byte) uint64 {
142
143
func LengthEncodedInt(b []byte) (num uint64, isNull bool, n int) {
144
if len(b) == 0 {
145
- return 0, true, 1
+ return 0, true, 0
146
147
148
switch b[0] {
0 commit comments