Skip to content

Commit 6d2067f

Browse files
committed
Merge pull request #349 from svagner/patch-1
Fix number reads bytes for mysql 5.6
2 parents 66b7d5c + 86bc8c6 commit 6d2067f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Runrioter Wung <runrioter at gmail.com>
3535
Soroush Pour <me at soroushjp.com>
3636
Xiaobing Jiang <s7v7nislands at gmail.com>
3737
Xiuming Chen <cc at cxm.cc>
38+
Stan Putrya <root.vagner at gmail.com>
3839

3940
# Organizations
4041

utils.go

+4
Original file line numberDiff line numberDiff line change
@@ -777,6 +777,10 @@ func skipLengthEncodedString(b []byte) (int, error) {
777777

778778
// returns the number read, whether the value is NULL and the number of bytes read
779779
func readLengthEncodedInteger(b []byte) (uint64, bool, int) {
780+
// See issue #349
781+
if len(b) == 0 {
782+
return 0, true, 1
783+
}
780784
switch b[0] {
781785

782786
// 251: NULL

0 commit comments

Comments
 (0)