From cd44929d7e460955766f30799ddfa7be6b861fd9 Mon Sep 17 00:00:00 2001 From: shenfeng Date: Wed, 20 Sep 2023 10:14:15 +0800 Subject: [PATCH 1/2] remove length check --- packets.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packets.go b/packets.go index 66635c55b..dc3421451 100644 --- a/packets.go +++ b/packets.go @@ -572,12 +572,9 @@ func (mc *okHandler) readResultSetHeaderPacket() (int, error) { } // column count - num, _, n := readLengthEncodedInteger(data) - if n-len(data) == 0 { - return int(num), nil - } + num, _, _ := readLengthEncodedInteger(data) + return int(num), nil - return 0, ErrMalformPkt } return 0, err } From 4d5f6a7f3e6ccff6748ec05cb740a86731d59d36 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Wed, 20 Sep 2023 11:35:44 +0900 Subject: [PATCH 2/2] Update packets.go --- packets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packets.go b/packets.go index dc3421451..4e27004aa 100644 --- a/packets.go +++ b/packets.go @@ -573,8 +573,8 @@ func (mc *okHandler) readResultSetHeaderPacket() (int, error) { // column count num, _, _ := readLengthEncodedInteger(data) + // ignore remaining data in the packet. see #1478. return int(num), nil - } return 0, err }