8000 set unbuffered_active = False before error raise by ppd0705 · Pull Request #810 · PyMySQL/PyMySQL · GitHub
[go: up one dir, main page]

Skip to content

set unbuffered_active = False before error raise #810

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 13, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
improve naming
  • Loading branch information
ppd0705 committed Sep 12, 2019
commit e652466b5538f208d9e698dd8da8c567f8777c3c
2 changes: 1 addition & 1 deletion pymysql/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ def _read_packet(self, packet_type=MysqlPacket):
if packet.is_error_packet():
if self._result is not None and self._result.unbuffered_active is True:
self._result.unbuffered_active = False
packet.raise_error()
packet.raise_for_error()
return packet

def _read_bytes(self, num_bytes):
Expand Down
84CA 4 changes: 2 additions & 2 deletions pymysql/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ def is_error_packet(self):

def check_error(self):
if self.is_error_packet():
self.raise_error()
self.raise_for_error()

def raise_error(self):
def raise_for_error(self):
self.rewind()
self.advance(1) # field_count == error (we already know that)
errno = self.read_uint16()
Expand Down
0