Documentation Home
MySQL Internals Manual
Download this Manual
EPUB - 0.8Mb


MySQL Internals Manual  /  ...  /  FORMAT_DESCRIPTION_EVENT

14.9.4.6 FORMAT_DESCRIPTION_EVENT

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.

Note

added 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:


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).


User Comments
Sign Up Login You must be logged in to post a comment.