Skip to content

Commit 4ae1f1f

Browse files
committed
fix new decimal parsing problem
1 parent a0f5638 commit 4ae1f1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pymysqlreplication/row_event.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,18 +320,18 @@ def __read_new_decimal(self, column):
320320

321321
for i in range(0, uncomp_integral):
322322
value = struct.unpack('>i', self.packet.read(4))[0] ^ mask
323-
res += str(value)
323+
res += '%09d' % value
324324

325325
res += "."
326326

327327
for i in range(0, uncomp_fractional):
328328
value = struct.unpack('>i', self.packet.read(4))[0] ^ mask
329-
res += str(value)
329+
res += '%09d' % value
330330

331331
size = compressed_bytes[comp_fractional]
332332
if size > 0:
333333
value = self.packet.read_int_be_by_size(size) ^ mask
334-
res += str(value)
334+
res += '%0*d' % (comp_fractional, value)
335335

336336
return decimal.Decimal(res)
337337

0 commit comments

Comments
 (0)