From edd8a1a895159031d1114474e4db49e3b158b78a Mon Sep 17 00:00:00 2001 From: Pete Hunt Date: Wed, 8 Dec 2010 05:56:29 +0000 Subject: [PATCH] Fix for issue 38, thanks google@evax.fr --- pymysql/connections.py | 19 +++++++++++++++---- pymysql/tests/test_issues.py | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/pymysql/connections.py b/pymysql/connections.py index 6671373..fb4bcdd 100644 --- a/pymysql/connections.py +++ b/pymysql/connections.py @@ -46,7 +46,7 @@ UNSIGNED_INT24_LENGTH = 3 UNSIGNED_INT64_LENGTH = 8 DEFAULT_CHARSET = 'latin1' -BUFFER_SIZE = 256*256*256-1 +MAX_PACKET_LENGTH = 256*256*256-1 def dump_packet(data): @@ -667,10 +667,21 @@ class Connection(object): return result.affected_rows def _send_command(self, command, sql): - send_data = struct.pack('= MAX_PACKET_LENGTH: + header = struct.pack('