connection.py fails on incomplete packet send
Bug #711520 reported by
David Creemer
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Connector/Python | Status tracked in Trunk | |||||
0.3 |
Fix Committed
|
High
|
Geert JM Vanderkelen | |||
Trunk |
Triaged
|
High
|
Geert JM Vanderkelen |
Bug Description
The inner loop of send_plain (and send_compressed) looks like this:
while pktlen:
pktlen -= self.sock.send(pkt)
On an incomplete self.sock.send, this will send the same data (from the start of pkt) on each loop iteration. Can I suggest something like this:
sent_ok = 0
while sent_ok < pktlen:
sent_ok += self.sock.
the key here is the use of "pkt[sent_ok:]" to advance the buffer pointer on each loop iteration.
I have encountered this problem when sending very large records.
Changed in myconnpy: | |
assignee: | nobody → Geert JM Vanderkelen (geertjmvdk) |
To post a comment you must log in.
Sorry for not replying this to this bug earlier:
Can we have some test case or an error which is thrown when you see the problem? Or how big are your records: one big field? lots of fields, but rather big ones?