WL#4078: Document binary format of binlog entries
Minor update with corrections and notes on the binlog format. This only affects comments, not code. sql/log_event.h: Fixes in documentation of binlog format.
This commit is contained in:
parent
5d1e8e12c3
commit
6988f45e6b
@ -670,18 +670,18 @@ typedef struct st_print_event_info
|
|||||||
Any @c Log_event saved on disk consists of the following three
|
Any @c Log_event saved on disk consists of the following three
|
||||||
components.
|
components.
|
||||||
|
|
||||||
* Common-Header
|
- Common-Header
|
||||||
* Post-Header
|
- Post-Header
|
||||||
* Body
|
- Body
|
||||||
|
|
||||||
The Common-Header, documented in the table @ref Table_common_header
|
The Common-Header, documented in the table @ref Table_common_header
|
||||||
"below", always has the same form and length within one version of
|
"below", always has the same form and length within one version of
|
||||||
MySQL. Each event type specifies a form and length of the
|
MySQL. Each event type specifies a format and length of the
|
||||||
Post-Header common to all events of the type. The Body may be of
|
Post-Header. The length of the Common-Header is the same for all
|
||||||
different form and length even for different events of the same
|
events of the same type. The Body may be of different format and
|
||||||
type. The binary formats of Post-Header and Body are documented
|
length even for different events of the same type. The binary
|
||||||
separately in each subclass. The binary format of Common-Header is
|
formats of Post-Header and Body are documented separately in each
|
||||||
as follows.
|
subclass. The binary format of Common-Header is as follows.
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<caption>Common-Header</caption>
|
<caption>Common-Header</caption>
|
||||||
@ -750,8 +750,8 @@ typedef struct st_print_event_info
|
|||||||
- Some events use a special format for efficient representation of
|
- Some events use a special format for efficient representation of
|
||||||
unsigned integers, called Packed Integer. A Packed Integer has the
|
unsigned integers, called Packed Integer. A Packed Integer has the
|
||||||
capacity of storing up to 8-byte integers, while small integers
|
capacity of storing up to 8-byte integers, while small integers
|
||||||
still can use 1, 3, or 4 bytes. The first byte indicates how many
|
still can use 1, 3, or 4 bytes. The value of the first byte
|
||||||
bytes are used by the integer, according to the following table:
|
determines how to read the number, according to the following table:
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<caption>Format of Packed Integer</caption>
|
<caption>Format of Packed Integer</caption>
|
||||||
@ -763,7 +763,7 @@ typedef struct st_print_event_info
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>0-250</td>
|
<td>0-250</td>
|
||||||
<td>The first byte is the number (in range 0-250), and no more
|
<td>The first byte is the number (in the range 0-250), and no more
|
||||||
bytes are used.</td>
|
bytes are used.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -1174,6 +1174,10 @@ protected:
|
|||||||
|
|
||||||
@section Query_log_event_binary_format Binary format
|
@section Query_log_event_binary_format Binary format
|
||||||
|
|
||||||
|
See @ref Log_event_binary_format "Binary format for log events" for
|
||||||
|
a general discussion and introduction to the binary format of binlog
|
||||||
|
events.
|
||||||
|
|
||||||
The Post-Header has five components:
|
The Post-Header has five components:
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
@ -1407,7 +1411,7 @@ protected:
|
|||||||
query "SELECT id, character_set_name, collation_name FROM
|
query "SELECT id, character_set_name, collation_name FROM
|
||||||
COLLATIONS".
|
COLLATIONS".
|
||||||
|
|
||||||
Cf. Q_CHARSET_DATABASE_NUMBER below.
|
Cf. Q_CHARSET_DATABASE_CODE below.
|
||||||
|
|
||||||
This field is always written.
|
This field is always written.
|
||||||
</td>
|
</td>
|
||||||
@ -1442,7 +1446,7 @@ protected:
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>charset_database_number</td>
|
<td>charset_database_number</td>
|
||||||
<td>Q_CHARSET_DATABASE_NUMBER == 8</td>
|
<td>Q_CHARSET_DATABASE_CODE == 8</td>
|
||||||
<td>2 byte integer</td>
|
<td>2 byte integer</td>
|
||||||
|
|
||||||
<td>The value of the collation_database system variable (in the
|
<td>The value of the collation_database system variable (in the
|
||||||
@ -1457,11 +1461,11 @@ protected:
|
|||||||
|
|
||||||
In newer versions, "CREATE TABLE" has been changed to take the
|
In newer versions, "CREATE TABLE" has been changed to take the
|
||||||
character set from the database of the created table, rather than
|
character set from the database of the created table, rather than
|
||||||
the database of the current database. This makes a difference
|
the character set of the current database. This makes a
|
||||||
when creating a table in another database than the current one.
|
difference when creating a table in another database than the
|
||||||
"LOAD DATA INFILE" has not yet changed to do this, but there are
|
current one. "LOAD DATA INFILE" has not yet changed to do this,
|
||||||
plans to eventually do it, and to make collation_database
|
but there are plans to eventually do it, and to make
|
||||||
read-only.
|
collation_database read-only.
|
||||||
|
|
||||||
This field is written if it is not 0.
|
This field is written if it is not 0.
|
||||||
</td>
|
</td>
|
||||||
@ -1480,7 +1484,7 @@ protected:
|
|||||||
Q_CATALOG_CODE will never be written by a new master, but can still
|
Q_CATALOG_CODE will never be written by a new master, but can still
|
||||||
be understood by a new slave.
|
be understood by a new slave.
|
||||||
|
|
||||||
* See Q_CHARSET_DATABASE_NUMBER in the table above.
|
* See Q_CHARSET_DATABASE_CODE in the table above.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
class Query_log_event: public Log_event
|
class Query_log_event: public Log_event
|
||||||
@ -1919,6 +1923,8 @@ private:
|
|||||||
|
|
||||||
@subsection Load_log_event_notes_on_previous_versions Notes on Previous Versions
|
@subsection Load_log_event_notes_on_previous_versions Notes on Previous Versions
|
||||||
|
|
||||||
|
This event type is understood by current versions, but only
|
||||||
|
generated by MySQL 3.23 and earlier.
|
||||||
*/
|
*/
|
||||||
class Load_log_event: public Log_event
|
class Load_log_event: public Log_event
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user