There is fix situation then mysql return 0 bytes for NULL column. This situation can be called with run statement "show slave hosts" at mysql 5.6 with slave mysql 5.5. In this case we got panic: out of range
@@ -777,6 +777,9 @@ func skipLengthEncodedString(b []byte) (int, error) {
// returns the number read, whether the value is NULL and the number of bytes read
func readLengthEncodedInteger(b []byte) (uint64, bool, int) {
+ if len(b) == 0 {
+ return 0, true, 1
+ }
switch b[0] {
// 251: NULL