MySql Binlog事件介绍篇( 三 )

20.PRE_GA_WRITE_ROWS_EVENT,PRE_GA_UPDATE_ROWS_EVENT和PRE_GA_DELETE_ROWS_EVENT
以上三个事件已经过期,被其他事件代替;
PRE_GA_WRITE_ROWS_EVENT被WRITE_ROWS_EVENT代替;
PRE_GA_UPDATE_ROWS_EVENT被UPDATE_ROWS_EVENT代替;
PRE_GA_DELETE_ROWS_EVENT被DELETE_ROWS_EVENT代替;
21.WRITE_ROWS_EVENT、UPDATE_ROWS_EVENT和DELETE_ROWS_EVENT
以上三个事件都被用在binlog_format为ROW模式下,分别对应inset,update和delete操作;
mysql> insert into btest values(997,88,'zhaohui');mysql> update btest set age=89 where id=997;mysql> delete from btest where id=997; mysql> show binlog events in 'bin-log.000004';+----------------+------+-------------+-----------+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |+----------------+------+-------------+-----------+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+...... || bin-log.000004 | 1164 | Query | 1 | 1232 | BEGIN || bin-log.000004 | 1232 | Table_map | 1 | 1280 | table_id: 33 (test.btest) || bin-log.000004 | 1280 | Write_rows | 1 | 1331 | table_id: 33 flags: STMT_END_F || bin-log.000004 | 1331 | Xid | 1 | 1358 | COMMIT /* xid=24 */ || bin-log.000004 | 1358 | Query | 1 | 1426 | BEGIN || bin-log.000004 | 1426 | Table_map | 1 | 1474 | table_id: 33 (test.btest) || bin-log.000004 | 1474 | Update_rows | 1 | 1548 | table_id: 33 flags: STMT_END_F || bin-log.000004 | 1548 | Xid | 1 | 1575 | COMMIT /* xid=25 */ || bin-log.000004 | 1575 | Query | 1 | 1643 | BEGIN || bin-log.000004 | 1643 | Table_map | 1 | 1691 | table_id: 33 (test.btest) || bin-log.000004 | 1691 | Delete_rows | 1 | 1742 | table_id: 33 flags: STMT_END_F || bin-log.000004 | 1742 | Xid | 1 | 1769 | COMMIT /* xid=27 */ |+----------------+------+-------------+-----------+-------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+22.INCIDENT_EVENT
主服务器发生了不正常的事件,通知从服务器并告知可能会导致数据处于不一致的状态;
23.HEARTBEAT_LOG_EVENT
主服务器告诉从服务器,主服务器还活着,不写入到日志文件中;
总结本文对Binlog的所有事件进行了大体的介绍,必要的时候也介绍了触发事件的条件;但是并没有深入介绍事件的fix data和variable data,后续文章会继续介绍这一块 。
参考:https://dev.mysql.com/doc/internals/en/event-meanings.html




推荐阅读