The footer, in the current version of the MySQL server, only contains the checksum algorithm descriptor.
More...
The footer, in the current version of the MySQL server, only contains the checksum algorithm descriptor.
The descriptor is contained in the FDE of the binary log. This is common for all the events contained in that binary log, and defines the algorithm used to checksum the events contained in the binary log.
The footer contains the following:
Common-Footer
Name | Format | Description
|
checkusm_alg | enum_checksum_alg | Algorithm used to checksum the events contained in the binary log
|
- Note
- checksum value is not generated with the event. On master's side, it is calculated right before writing the event into the binary log. The data_written field of the event is adjusted (+BINLOG_CHECKSUM_LEN) to consider the checksum value as part of the event. On reading the event, if the Format Description Event (FDE) used when serializing the event tells that the events have checksum information, the checksum value can be retrieved from a particular offset of the serialized event buffer (event length - BINLOG_CHECKSUM_LEN) and checked for corruption by computing a new value over the event buffer. It is not required after that. Therefore, the checksum value is not required to be stored in the instance as a class member.
The method returns the checksum algorithm used to checksum the binary log from a Format Description Event serialized buffer.
The method returns the checksum algorithm used to checksum the binary log.
For MySQL server versions < 5.6, the algorithm is undefined.
- Parameters
-
buf | buffer holding serialized FD event. |
len | length of the event buffer. |
- Return values
-
BINLOG_CHECKSUM_ALG_UNDEF | originator is checksum-unaware (effectively no checksum). |
BINLOG_CHECKSUM_ALG_OFF | no checksum. |
other | the actual checksum algorithm descriptor. |
For MySQL server versions < 5.6, the algorithm is undefined. For the higher versions, the type is decoded from the FORMAT_DESCRIPTION_EVENT.
- Parameters
-
buf | buffer holding serialized FD event |
len | netto (possible checksum is stripped off) length of the event buf |
- Returns
- the version-safe checksum alg descriptor where zero designates no checksum, 255 - the orginator is checksum-unaware (effectively no checksum) and the actual [1-254] range alg descriptor.