From 4baa2602af289b4f44913c77e8badf41399e4f7a Mon Sep 17 00:00:00 2001 From: Diana Clarke Date: Wed, 31 Aug 2016 14:55:43 -0400 Subject: [PATCH] Revert error packet parsing changes Revert the changes made in commit 02910b7 to the mysql error packet parsing, as it didn't take the CLIENT_PROTOCOL_41 case into account. It appears that the non-CLIENT_PROTOCOL_41 case was off by one as well (sliced data on 4 vs 3). I also added two new tests to cover those cases. See: https://dev.mysql.com/doc/internals/en/packet-ERR_Packet.html --- pymysql/err.py | 7 ++++++- pymysql/tests/__init__.py | 1 + pymysql/tests/test_err.py | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 pymysql/tests/test_err.py diff --git a/pymysql/err.py b/pymysql/err.py index 70beb33c..24862632 100644 --- a/pymysql/err.py +++ b/pymysql/err.py @@ -97,6 +97,11 @@ def _map_error(exc, *errors): def raise_mysql_exception(data): errno = struct.unpack('