Added checksum calculations for events larger than 2^24 bytes

The checksums are now properly calculated for large events that span multiple
SQL packets.
This commit is contained in:
Markus Makela
2016-02-12 08:31:50 +02:00
parent 3609f97ba0
commit 2b7e2d3043
3 changed files with 94 additions and 74 deletions

View File

@ -424,6 +424,7 @@ typedef struct router_instance {
int trx_safe; /*< Detect and handle partial transactions */
int pending_transaction; /*< Pending transaction */
enum blr_event_state master_event_state; /*< Packet read state */
uint32_t stored_checksum; /*< The current value of the checksum */
REP_HEADER stored_header; /*< Relication header of the event the master is sending */
uint64_t last_safe_pos; /* last committed transaction */
char binlog_name[BINLOG_FNAMELEN+1];

View File

@ -70,6 +70,7 @@
#define GW_MYSQL_READ 0
#define GW_MYSQL_WRITE 1
#define MYSQL_HEADER_LEN 4L
#define MYSQL_CHECKSUM_LEN 4L
#define GW_MYSQL_PROTOCOL_VERSION 10 // version is 10
#define GW_MYSQL_HANDSHAKE_FILLER 0x00