Skip to content

Commit 0323693

Browse files
committed
enum catch out of index
enum when Mysql 5.7 case error
1 parent 6a03460 commit 0323693

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
@@ -207,7 +207,10 @@ def __read_values_name(
207207
elif column.type == FIELD_TYPE.YEAR:
208208
return self.packet.read_uint8() + 1900
209209
elif column.type == FIELD_TYPE.ENUM:
210-
return column.enum_values[self.packet.read_uint_by_size(column.size)]
210+
if column.enum_values:
211+
return column.enum_values[self.packet.read_uint_by_size(column.size)]
212+
self.packet.read_uint_by_size(column.size)
213+
return None
211214
elif column.type == FIELD_TYPE.SET:
212215
bit_mask = self.packet.read_uint_by_size(column.size)
213216
return (
@@ -873,6 +876,7 @@ def _sync_column_info(self):
873876
self.table_obj = Table(
874877
self.table_id, self.schema, self.table, self.columns, column_name_flag=True
875878
)
879+
print(self.table_obj.data)
876880

877881
def _convert_include_non_numeric_column(self, signedness_bool_list):
878882
# The incoming order of columns in the packet represents the indices of the numeric columns.

0 commit comments

Comments
 (0)