mysqlbinlog_max_binlog_statement_size
Description
By default, mysqlbinlog combines all row events corresponding to a single statement into one BINLOG statement when reading a binary log. Therefore, the resulting BINLOG statements could be arbitrarily long for INSERT/DELETE/UPDATE statements affecting many rows on the master, even when the individual row events are small. This could lead to problems with roll-forwarding when the server's max_allowed_packet was not large enough to accomodate the largest BINLOG statement.
For example, removing 1 GB of data with a single DELETE statement from a table with a maximum row size of 1 MB would likely result in multiple DELETE_ROWS_EVENT events, depending on the value of the binlog-row-event-max-size server system variable. However, when reading those events from the binary log, mysqlbinlog would combine them into a 1 GB (+ base64 overhead) BINLOG statement which would lead to the ER_NET_PACKET_TOO_LARGE error when piped into the server.
This feature fixes that problem by introducing a new mysqlbinlog command line option, –binlog-stmt-max-size. The option sets an upper limit on the size of the generated BINLOG statements when possible, i.e. when the size of individual row events does not exceed this limit. The default value for the option is 1 MB.
Version Specific Information
| Percona Server Version | Comments |
|---|---|
| release-5.1.52-12-rnt | Full functionality available. |
Other Information
| Author/Origin | Alexey Kopytov |
Command line options
| General Description: | |
|---|---|
| Utility | mysqlbinlog |
| Command Line | Yes |
| Config File | Yes |
| Permitted Values: | |
| Type | Numeric |
| Default Value | 1048576 |
| Range | 0 - 4294967295 |
| Units | bytes |


