diff options
author | Michael Widenius <monty@askmonty.org> | 2009-11-26 17:57:05 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2009-11-26 17:57:05 +0200 |
commit | 5c9089136fbe9a927ed80117ae26a2401f76850a (patch) | |
tree | 53d50e9eae0bd68d2823409f0bff8eca7c9c15ef | |
parent | bf443b4462d72cdaa916e0398839b65fb9755dcb (diff) | |
download | mariadb-git-5c9089136fbe9a927ed80117ae26a2401f76850a.tar.gz |
Fix for Bug #48357 SHOW BINLOG EVENTS: Wrong offset or I/O error
sql/log_event.cc:
gcc 4.4.1 assumes that variables that you cast away will not change (strict-aliasing)
The symptom was that mysql-test-run binlog.binglog_database got errors in the log
-rw-r--r-- | sql/log_event.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 6aa5365a708..518bb6e34e5 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2133,7 +2133,7 @@ void Query_log_event::pack_info(Protocol *protocol) /** Utility function for the next method (Query_log_event::write()) . */ -static void write_str_with_code_and_len(char **dst, const char *src, +static void write_str_with_code_and_len(uchar **dst, const char *src, int len, uint code) { /* @@ -2143,7 +2143,7 @@ static void write_str_with_code_and_len(char **dst, const char *src, DBUG_ASSERT(len <= 255); DBUG_ASSERT(src); *((*dst)++)= code; - *((*dst)++)= (uchar) len; + *((*dst)++)= len; bmove(*dst, src, len); (*dst)+= len; } @@ -2229,7 +2229,7 @@ bool Query_log_event::write(IO_CACHE* file) } if (catalog_len) // i.e. this var is inited (false for 4.0 events) { - write_str_with_code_and_len((char **)(&start), + write_str_with_code_and_len(&start, catalog, catalog_len, Q_CATALOG_NZ_CODE); /* In 5.0.x where x<4 masters we used to store the end zero here. This was @@ -2267,7 +2267,7 @@ bool Query_log_event::write(IO_CACHE* file) { /* In the TZ sys table, column Name is of length 64 so this should be ok */ DBUG_ASSERT(time_zone_len <= MAX_TIME_ZONE_NAME_LENGTH); - write_str_with_code_and_len((char **)(&start), + write_str_with_code_and_len(&start, time_zone_str, time_zone_len, Q_TIME_ZONE_CODE); } if (lc_time_names_number) |