row格式的binlog文件中,每个ROW_EVENT之前都有一个TABLE_MAP_EVENT,用于描述表的内部ID和结构定义。
mysql> show binlog events in "mysql-bin.000002";
+------------------+-----+-------------+-----------+-------------+---------------------------------------------+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+------------------+-----+-------------+-----------+-------------+---------------------------------------------+
| mysql-bin.000002 | 4 | Format_desc | 11 | 120 | Server ver: 5.6.26-debug-log, Binlog ver: 4 |
| mysql-bin.000002 | 120 | Query | 11 | 191 | BEGIN |
| mysql-bin.000002 | 191 | Table_map | 11 | 236 | table_id: 70 (yzs.t1) |
| mysql-bin.000002 | 236 | Write_rows | 11 | 280 | table_id: 70 flags: STMT_END_F |
| mysql-bin.000002 | 280 | Xid | 11 | 311 | COMMIT /* xid=9 */ |
| mysql-bin