Skip to content

Commit

Permalink
gtid: intervals are now right-opened on mysql wire representation
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Gautier <baloo@gandi.net>
  • Loading branch information
Arthur Gautier committed Apr 18, 2017
1 parent 741e036 commit 12fa003
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pymysqlreplication/gtid.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def decode(cls, payload):
intervals = []
for i in range(0, n_intervals):
start, end = struct.unpack('<QQ', payload.read(16))
intervals.append((start, end))
intervals.append((start, end-1))

return cls('%s:%s' % (sid.decode('ascii'), ':'.join([
'%d-%d' % x
Expand Down
2 changes: 1 addition & 1 deletion pymysqlreplication/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ def test_gtidset_representation_newline(self):
myset = GtidSet(mysql_repr)
self.assertEqual(str(myset), set_repr)

def test_gtidset_representation(self):
def test_gtidset_representation_payload(self):
set_repr = '57b70f4e-20d3-11e5-a393-4a63946f7eac:1-56,' \
'4350f323-7565-4e59-8763-4b1b83a0ce0e:1-20'

Expand Down

0 comments on commit 12fa003

Please sign in to comment.