This section describes the files in a MySQL source tree that are most relevent to binary log processing.
sql directory:
log.h /log.cc: The
high-level binary logging mechanism for organizing events into
a sequence so that it becomes a binary log. Routines for
creating, writing, deleting binary log files.
log_event.h
/log_event.cc: The low-level binary logging
mechanism for serializing of values into records. The
Log_event class and subclasses, for creating, writing,
reading, printing, and applying events of every event type.
Reading and writing here is at a low level, that is,
serializing values into records.
rpl_constants.h : Contains codes for
INCIDENT_EVENT incident types.
slave.cc : Contains some logic for
processing binary logs in a replication slave (the IO and SQL
threads).
rpl_injector.h
/rpl_injector.cc: Contains the injector
class that allows external insertions into the binary log.
This is used for cluster replication binary logging.
rpl_record.h
/rpl_record.cc: Utilities for encoding and
decoding table rows into and out of the format used by row
events.
rpl_tblmap.h
/rpl_tblmap.cc: Contains a mapping from
numbers to tables. The mapping is used by the row logging
system to identify tables.
rpl_utility.h
/rpl_utility.cc: Contains auxiliary classes
and functions used for Table_map_events,
and also an auxiliary class for smart pointers
sql_binlog.cc : Code to execute
BINLOG statements (the base64-encoded
values that mysqlbinlog prints when it sees
row events).
sql_base.cc : The function
decide_logging_format() that determines
whether statements should be written to the binary log using
row-based or statement-based format.
client directory:
mysqlbinlog.cc : The source for the
mysqlbinlog utility that reads binary log files and displays
them in text format. It shares some event-interpretation code
with the server.
log_event_old.h/log_event_old.cc
(present in MySQL 5.1.18 and up): Classes to read and execute
old versions of the row log events:
Write_rows_log_event_old
Update_rows_log_event_old
Delete_rows_log_event_old
Prior to MySQL 5.1.17, those classes were known as:
Write_rows_log_event
Update_rows_log_event
Delete_rows_log_event
For information about the relationship of the
Xxx_rows_log_event and
Xxx_row_log_event_old classes, see
#Event Classes and
Types.
