Skip to content

Commit

Permalink
Merge pull request holland-backup#145 from abg/revert_show_slave_stat…
Browse files Browse the repository at this point in the history
…us_binary

Revert broken SHOW SLAVE STATUS fix for LP#1220841
  • Loading branch information
abg committed Mar 1, 2016
2 parents 779968f + 89bd619 commit 65239a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 12 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ http://bugs.launchpad.net/holland-backup
GH# referes to the deprecated github bug tracker here:
https://github.com/holland-backup/holland/issues

1.0.14 - unreleased
-------------------

holland
+++++++

- A fix for launchpad bug #1220841 caused plugins that used
"SHOW SLAVE STATUS" via the holland mysql lib to fail with
an "unknown encoding: binary" error. The changes for
LP #1220841 have been reverted.


1.0.12 - Feb 8, 2016
--------------------

Expand Down
10 changes: 1 addition & 9 deletions plugins/holland.lib.mysql/holland/lib/mysql/client/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,8 @@ def show_slave_status(self):
:returns: slave status dict
"""
sql = "SHOW SLAVE STATUS"
charset = self.character_set_name()
cursor = self.cursor()
try:
self.set_character_set('binary')
cursor.execute(sql)
keys = [col[0].lower() for col in cursor.description]
slave_status = cursor.fetchone()
Expand All @@ -334,14 +332,8 @@ def show_slave_status(self):
if not slave_status:
return None
else:
result = []
for value in slave_status:
if isinstance(value, basestring):
value = value.decode(charset, 'ignore')
result.append(value)
return dict(zip(keys, result))
return dict(zip(keys, slave_status))
finally:
self.set_character_set(charset)
cursor.close()

def show_master_status(self):
Expand Down

0 comments on commit 65239a2

Please sign in to comment.