diff options
author | Sven Sandberg <sven@mysql.com> | 2009-01-09 10:48:01 +0100 |
---|---|---|
committer | Sven Sandberg <sven@mysql.com> | 2009-01-09 10:48:01 +0100 |
commit | 5c92f27f63b0bd97448474fb26329504810fb978 (patch) | |
tree | c4cf61a0f647146ae6ec41465558fdadb62b8f97 /sql/log_event.h | |
parent | 335e842d24083e8961b7f6b7e9563628dcb8956d (diff) | |
download | mariadb-git-5c92f27f63b0bd97448474fb26329504810fb978.tar.gz |
BUG#41961: Some log_event types do not skip post-header when reading
Problem: when the server reads a log_event from file, it should read
the post-header lengths from the format_description_log_event. Some
event types which currently have post-header length 0 did not do this,
and instead had a hard-coded zero length for the post-header. That
means the current server version will not be able to read future
versions of these events.
Fix: make the reader functions read the post-header.
sql/log_event.cc:
- Made Format_description_log_event constructor initialize all
post-header lengths explicitly, to make it easier to find them
in the source code.
- After this, it is no longer necessary to pass the MY_ZEROFILL
flag to my_malloc. I removed the flag and added a sanity-check
that will be executed only in debug-mode.
- Made INTVAR, RAND, USER_VAR, and XID events skip post_header_len
when reading from file.
sql/log_event.h:
Added explicit defines for the lengths of all event types.
Diffstat (limited to 'sql/log_event.h')
-rw-r--r-- | sql/log_event.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/log_event.h b/sql/log_event.h index db14341b51d..185d2d21a02 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -227,14 +227,22 @@ struct sql_ex_info #define QUERY_HEADER_MINIMAL_LEN (4 + 4 + 1 + 2) // where 5.0 differs: 2 for len of N-bytes vars. #define QUERY_HEADER_LEN (QUERY_HEADER_MINIMAL_LEN + 2) +#define STOP_HEADER_LEN 0 #define LOAD_HEADER_LEN (4 + 4 + 4 + 1 +1 + 4) +#define SLAVE_HEADER_LEN 0 #define START_V3_HEADER_LEN (2 + ST_SERVER_VER_LEN + 4) #define ROTATE_HEADER_LEN 8 // this is FROZEN (the Rotate post-header is frozen) +#define INTVAR_HEADER_LEN 0 #define CREATE_FILE_HEADER_LEN 4 #define APPEND_BLOCK_HEADER_LEN 4 #define EXEC_LOAD_HEADER_LEN 4 #define DELETE_FILE_HEADER_LEN 4 +#define NEW_LOAD_HEADER_LEN LOAD_HEADER_LEN +#define RAND_HEADER_LEN 0 +#define USER_VAR_HEADER_LEN 0 #define FORMAT_DESCRIPTION_HEADER_LEN (START_V3_HEADER_LEN+1+LOG_EVENT_TYPES) +#define XID_HEADER_LEN 0 +#define BEGIN_LOAD_QUERY_HEADER_LEN APPEND_BLOCK_HEADER_LEN #define ROWS_HEADER_LEN 8 #define TABLE_MAP_HEADER_LEN 8 #define EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN (4 + 4 + 4 + 1) |