Skip to content

Commit a384964

Browse files
committed
bypass table map event in some weird cases.
1 parent 7e582fb commit a384964

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pymysqlreplication/row_event.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,12 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection):
483483
# Read columns meta data
484484
column_types = list(self.packet.read(self.column_count))
485485
self.packet.read_length_coded_binary()
486-
for i in range(0, len(column_types)):
487-
column_type = column_types[i]
488-
column_schema = self.column_schemas[i]
489-
col = Column(byte2int(column_type), column_schema, from_packet)
490-
self.columns.append(col)
486+
if self.column_schemas:
487+
for i in range(0, len(column_types)):
488+
column_type = column_types[i]
489+
column_schema = self.column_schemas[i]
490+
col = Column(byte2int(column_type), column_schema, from_packet)
491+
self.columns.append(col)
491492

492493
self.table_obj = Table(self.column_schemas, self.table_id, self.schema,
493494
self.table, self.columns)

0 commit comments

Comments
 (0)