- Binlog::FORMAT_DESCRIPTION_EVENT:
-
A format description event is the first event of a binlog for binlog-version 4. It describes how the other events are layed out.
Noteadded in MySQL 5.0.0 as replacement for START_EVENT_V3
- Payload
2 binlog-version string[50] mysql-server version 4 create timestamp 1 event header length string[p] event type header lengths
- Fields
binlog-version (2) -- version of this binlog format.
mysql-server version (string.fix_len) -- [len=50] version of the MySQL Server that created the binlog. The string is evaluted to apply work-arounds in the slave.
create_timestamp (4) -- seconds since Unix epoch when the binlog was created
event_header_length (1) -- length of the Binlog Event Header of next events. Should always be 19.
event type header length (string.EOF) -- a array indexed by
Binlog Event Type
- 1 to extract the length of the event specific header.
- Example
$ hexdump -v -s 4 -C relay-bin.000001 00000004 82 2d c2 4b 0f 02 00 00 00 67 00 00 00 6b 00 00 |.-.K.....g...k..| 00000014 00 00 00 04 00 35 2e 35 2e 32 2d 6d 32 00 00 00 |.....5.5.2-m2...| 00000024 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000034 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000044 00 00 00 00 00 00 00 82 2d c2 4b 13 38 0d 00 08 |........-.K.8...| 00000054 00 12 00 04 04 04 04 12 00 00 54 00 04 1a 08 00 |..........T.....| 00000064 00 00 08 08 08 02 00 |........ |
For mysql-5.5.2-m2
the event specific
header lengths are:
Table 14.6 Event Type Header Lengths by Binlog Version
Event Name |
Header Length |
||
---|---|---|---|
v=4 |
v=3 |
v=1 |
|
19 |
13 |
||
56 |
|||
13 |
11 |
||
0 |
|||
8 |
0 |
||
0 |
|||
18 |
|||
0 |
|||
4 |
|||
4 |
|||
4 |
|||
4 |
|||
18 |
|||
0 |
|||
0 |
|||
84 |
--- |
||
0 |
--- |
||
4 |
--- |
||
26 |
--- |
||
8 |
--- |
||
0 |
--- |
||
0 |
--- |
||
0 |
--- |
||
8/6 |
--- |
||
8/6 |
--- |
||
8/6 |
--- |
||
2 |
--- |
||
0 |
--- |
||
10 |
--- |
||
10 |
--- |
||
10 |
--- |
The event-size of 0x67 (103)
minus the
event-header length of 0x13 (19)
should
match the event type header length of the
FORMAT_DESCRIPTION_EVENT
0x54 (84)
.
The number of events understood by the master may differ from what the slave supports. It is calculated by:
event-size - event-header length - 2 - 50 - 4 - 1
For mysql-5.5.2-m2
it is 0x1b
(27)
.