From 73e88b80411f4ca61134b4eb1ba99274799cfef4 Mon Sep 17 00:00:00 2001 From: diana Date: Wed, 31 Aug 2016 22:06:58 -0400 Subject: [PATCH] Revert error packet parsing changes (#508) 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 70beb33..2486263 100644 --- a/pymysql/err.py +++ b/pymysql/err.py @@ -97,6 +97,11 @@ del _map_error, ER def raise_mysql_exception(data): errno = struct.unpack('