This is a read-only copy of the MariaDB Knowledgebase generated on 2024-11-25. For the latest, interactive version please visit https://mariadb.com/kb/.

FORMAT_DESCRIPTION_EVENT

This is a descriptor event that is written to the beginning of a binary log file, at position 4 (after the 4 magic number bytes)

The whole event written to disk is byte<19> event header + data fields

  • The Event Type is 15 (0x0f)

Fields

  • uint<2> The binary log format version. This is 4 in MariaDB 10 and up.
  • string<50> The MariaDB server version (example: 10.2.1-debug-log), padded with 0x00 bytes on the right.
  • uint<4> Timestamp in seconds when this event was created (this is the moment when the binary log was created). This value is redundant; the same value occurs in the timestamp header field.
  • uint<1> The header length. This length - 19 gives the size of the extra headers field at the end of the header for other events.
  • byte<n> Variable-sized. An array that indicates the post-header lengths for all event types.
    There is one byte per event type that the server knows about.
    The value 'n' comes from the following formula:
n = event_size - header length - offset (2 + 50 + 4 + 1) - checksum_algo - checksum
  • uint<1> Checksum Algorithm Type
  • uint<4> CRC32 4 bytes (value matters only if checksum algo is CRC32)

Example FDE of MariaDB 10.2.10 With CRC32

4d af 15 5a 0f 01 00 00  00 fc 00 00 00 00 01 00  M..Z............
00 00 00 04 00 31 30 2e  32 2e 31 30 2d 4d 61 72  .....10.2.10-Mar
69 61 44 42 2d 6c 6f 67  00 00 00 00 00 00 00 00  iaDB-log.......
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00 00 00 00 00 00 00 00  00 00 00 4d af 15 5a 13  ...........M..Z.
00 12 00 04 04 04 04 12  00 00 e4 00 04 1a 08 00  ................
00 00 08 08 08 02 00 00  00 0a 0a 0a 00 00 00 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 04 13 04 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 04 13 04 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 04 13 04 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 04 13 04 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 04 13 04 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 04 13 04 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 04 13 04 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 04 13 04 00  ................
0d 08 08 08 0a 0a 0a 01  d6 ce 13 e2              ............

Header, 19 Bytes

  • timestamp => 4d af 15 5a
  • type = 0f => 15
  • server_id = 1
  • Event Size = fc => 252
  • Next Pos = 00 01 00 00 => 00 00 01 00 => 256
  • Flags = 00 => 0

Content, Variable Size Depending on MariaDB Versions

  • format version = 04 00 => 4
  • server's version = 10.2.10-MariaDB-log .... [50 bytes]
  • create time = 4d af 15 5a
  • header_length = 13 => 19
  • event_types array[252 - 19 - (2 + 50 + 4 +1) - 1 - 4] = 171 supported events
  • checksum_algo = 01 => 1 (CRC32)
  • CRC32 bytes = d6 ce 13 e2

Example FDE of MariaDB 10.1.16 With CRC32

12 ad 26 5a 0f 84 27 00  00 f5 00 00 00 f9 00 00  ..&Z..'.........
00 01 00 04 00 31 30 2e  31 2e 31 36 2d 4d 61 72  .....10.1.16-Mar
69 61 44 42 00 6c 6f 67  00 00 00 00 00 00 00 00  iaDB.log........
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00 00 00 00 00 00 00 12  ad 26 5a 13 38 0d 00 08  .........&Z.8...
00 12 00 04 04 04 04 12  00 00 dd 00 04 1a 08 00  ................
00 00 08 08 08 02 00 00  00 0a 0a 0a 00 00 00 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
00 00 00 00 00 00 00 00  00 00 00 00 04 13 04 00  ................
00 2b 91 c2 91

Header, 19 Bytes

  • timestamp => 12 ad 26 5aa
  • type = 0f => 15
  • server_id = 84 27 00 00 => 00 00 27 84 => 10116
  • Event Size = fc => 245
  • Next Pos = f9 00 00 00 => 00 00 00 f9 => 249
  • Flags = 00 => 0

Content, Variable Size Depending on MariaDB Versions

  • format version = 04 00 => 4
  • server's version = 10.1.16-MariaDB.log .... [50 bytes]
  • create time = 12 ad 26 5a
  • header_length = 13 => 19
  • event_types array[245 - 19 - (2 + 50 + 4 +1) - 1 - 4] = 164 supported events
  • checksum_algo = 0 => 0 (NONE)
  • CRC32 bytes = 2b 91 c2 91 (useless)
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.