My Project
Public Member Functions | Public Attributes
Format_description_log_event Class Reference

#include <log_event.h>

Inheritance diagram for Format_description_log_event:
Start_log_event_v3 Log_event

List of all members.

Public Member Functions

 Format_description_log_event (uint8 binlog_ver, const char *server_ver=0)
 Format_description_log_event (const char *buf, uint event_len, const Format_description_log_event *description_event)
Log_event_type get_type_code ()
bool header_is_valid () const
bool version_is_valid () const
bool is_valid () const
int get_data_size ()
void calc_server_version_split ()
ulong get_version_product () const
bool is_version_before_checksum () const

Public Attributes

uint8 common_header_len
uint8 number_of_event_types
uint8 * post_header_len
uchar server_version_split [3]
const uint8 * event_type_permutation

Detailed Description

For binlog version 4. This event is saved by threads which read it, as they need it for future use (to decode the ordinary events).

Binary Format


Constructor & Destructor Documentation

Format_description_log_event::Format_description_log_event ( uint8  binlog_ver,
const char *  server_ver = 0 
)

Format_description_log_event 1st ctor.

Ctor. Can be used to create the event to write to the binary log (when the server starts or when FLUSH LOGS), or to create artificial events to parse binlogs from MySQL 3.23 or 4.x. When in a client, only the 2nd use is possible.

Parameters:
binlog_versionthe binlog version for which we want to build an event. Can be 1 (=MySQL 3.23), 3 (=4.0.x x>=2 and 4.1) or 4 (MySQL 5.0). Note that the old 4.0 (binlog version 2) is not supported; it should not be used for replication with 5.0.
server_vera string containing the server version.
Format_description_log_event::Format_description_log_event ( const char *  buf,
uint  event_len,
const Format_description_log_event description_event 
)

The problem with this constructor is that the fixed header may have a length different from this version, but we don't know this length as we have not read the Format_description_log_event which says it, yet. This length is in the post-header of the event, but we don't know where the post-header starts.

So this type of event HAS to:

  • either have the header's length at the beginning (in the header, at a fixed position which will never be changed), not in the post-header. That would make the header be "shifted" compared to other events.
  • or have a header of size LOG_EVENT_MINIMAL_HEADER_LEN (19), in all future versions, so that we know for sure.

I (Guilhem) chose the 2nd solution. Rotate has the same constraint (because it is sent before Format_description_log_event).


Member Function Documentation

'server_version_split' is used for lookups to find if the server which created this event has some known bug.

Returns:
integer representing the version of server that originated the current FD instance.
Returns:
TRUE is the event's version is earlier than one that introduced the replication event checksum. FALSE otherwise.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines