Skip to content

Commit 12fa003

Browse files
author
Arthur Gautier
committed
gtid: intervals are now right-opened on mysql wire representation
Signed-off-by: Arthur Gautier <baloo@gandi.net>
1 parent 741e036 commit 12fa003

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pymysqlreplication/gtid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def decode(cls, payload):
227227
intervals = []
228228
for i in range(0, n_intervals):
229229
start, end = struct.unpack('<QQ', payload.read(16))
230-
intervals.append((start, end))
230+
intervals.append((start, end-1))
231231

232232
return cls('%s:%s' % (sid.decode('ascii'), ':'.join([
233233
'%d-%d' % x

pymysqlreplication/tests/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ def test_gtidset_representation_newline(self):
846846
myset = GtidSet(mysql_repr)
847847
self.assertEqual(str(myset), set_repr)
848848

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

0 commit comments

Comments
 (0)