Skip to content

Commit 8bbc80f

Browse files
committed
Column read String Mysql 5version
1 parent 3233f56 commit 8bbc80f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pymysqlreplication/row_event.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,18 @@ def charset_to_encoding(name):
260260
def __read_string(self, size, column):
261261
string = self.packet.read_length_coded_pascal_string(size)
262262
origin_string = string
263+
decode_errors = "ignore" if self._ignore_decode_errors else "strict"
263264
if column.character_set_name is not None:
264265
encoding = self.charset_to_encoding(column.character_set_name)
265-
decode_errors = "ignore" if self._ignore_decode_errors else "strict"
266266
try:
267267
string = string.decode(encoding, decode_errors)
268268
except LookupError:
269269
# python does not support Mysql encoding type ex)swe7 it will not decoding then Show origin string
270270
string = origin_string
271+
else:
272+
# MYSQL 5.xx Version Goes Here
273+
# We don't know encoding type So apply Default Utf-8
274+
string = string.decode(errors=decode_errors)
271275
return string
272276

273277
def __read_bit(self, column):

0 commit comments

Comments
 (0)