@@ -323,14 +323,17 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection):
323
323
324
324
self .columns = []
325
325
326
- column_schemas = self .__get_table_informations (self .schema , self .table )
326
+ if self .table_id in table_map :
327
+ self .column_schemas = table_map [self .table_id ].column_schemas
328
+ else :
329
+ self .column_schemas = self .__get_table_informations (self .schema , self .table )
327
330
328
331
#Read columns meta data
329
332
column_types = list (self .packet .read (self .column_count ))
330
333
metadata_length = self .packet .read_length_coded_binary ()
331
334
for i in range (0 , len (column_types )):
332
335
column_type = column_types [i ]
333
- column_schema = column_schemas [i ]
336
+ column_schema = self . column_schemas [i ]
334
337
col = Column (byte2int (column_type ), column_schema , from_packet )
335
338
self .columns .append (col )
336
339
@@ -339,7 +342,6 @@ def __init__(self, from_packet, event_size, table_map, ctl_connection):
339
342
# n NULL-bitmask, length: (column-length * 8) / 7
340
343
341
344
def __get_table_informations (self , schema , table ):
342
- #TODO: Cache this information
343
345
cur = self ._ctl_connection .cursor ()
344
346
cur .execute ("""SELECT * FROM columns WHERE table_schema = %s AND table_name = %s""" , (schema , table ))
345
347
return cur .fetchall ()
0 commit comments