Skip to content
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

To fix the bug caused by DictCursor mode. #136

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
11 changes: 9 additions & 2 deletions pymysqlreplication/binlogstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ def __checksum_enabled(self):

if result is None:
return False
var, value = result[:2]
if type(result) == type({}):
value = result["Value"]
else:
var, value = result[:2]
if value == 'NONE':
return False
return True
Expand All @@ -140,7 +143,11 @@ def __connect_to_stream(self):
if self.log_file is None or self.log_pos is None:
cur = self._stream_connection.cursor()
cur.execute("SHOW MASTER STATUS")
self.log_file, self.log_pos = cur.fetchone()[:2]
data = cur.fetchone()
if type(data) == type({}):
self.log_file, self.log_pos = data["File"], data["Position"]
else:
self.log_file, self.log_pos = cur.fetchone()[:2]
cur.close()

prelude = struct.pack('<i', len(self.log_file) + 11) \
Expand Down