Loading mysql-test/suite/binlog/r/binlog_old_versions.result +10 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,16 @@ SELECT COUNT(*) FROM t3; COUNT(*) 17920 DROP TABLE t1, t2, t3; ==== Read binlog from version 4.1 ==== SELECT * FROM t1 ORDER BY a; a b 0 last_insert_id 4 four 190243 random SELECT COUNT(*) FROM t3; COUNT(*) 17920 DROP TABLE t1, t3; ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ==== SELECT * FROM t1 ORDER BY a; a b Loading mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001 0 → 100644 +146 KiB File added.No diff preview for this file type. View file mysql-test/suite/binlog/t/binlog_old_versions.test +15 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,21 @@ SELECT COUNT(*) FROM t3; DROP TABLE t1, t2, t3; --echo ==== Read binlog from version 4.1 ==== # In this version, neither row-based binlogging nor Xid events # existed, so the binlog was generated without the "row-based tests" # part and the "get xid event" part, and it does not create table t2. # Read binlog. --exec $MYSQL_BINLOG suite/binlog/std_data/binlog_old_version_4_1.000001 | $MYSQL # Show result. SELECT * FROM t1 ORDER BY a; SELECT COUNT(*) FROM t3; # Reset. DROP TABLE t1, t3; --echo ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ==== # In this version, it was not possible to switch between row-based and Loading sql/log_event.cc +12 −12 Original line number Diff line number Diff line Loading @@ -236,9 +236,9 @@ uint debug_not_change_ts_if_art_event= 1; // bug#29309 simulation */ #ifdef MYSQL_CLIENT static void pretty_print_str(IO_CACHE* cache, char* str, int len) static void pretty_print_str(IO_CACHE* cache, const char* str, int len) { char* end = str + len; const char* end = str + len; my_b_printf(cache, "\'"); while (str < end) { Loading Loading @@ -301,9 +301,9 @@ inline int ignored_error_code(int err_code) */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) static char *pretty_print_str(char *packet, char *str, int len) static char *pretty_print_str(char *packet, const char *str, int len) { char *end= str + len; const char *end= str + len; char *pos= packet; *pos++= '\''; while (str < end) Loading Loading @@ -412,7 +412,7 @@ static void cleanup_load_tmpdir() write_str() */ static bool write_str(IO_CACHE *file, char *str, uint length) static bool write_str(IO_CACHE *file, const char *str, uint length) { uchar tmp[1]; tmp[0]= (uchar) length; Loading Loading @@ -6080,7 +6080,8 @@ bool sql_ex_info::write_data(IO_CACHE* file) sql_ex_info::init() */ char *sql_ex_info::init(char *buf, char *buf_end, bool use_new_format) const char *sql_ex_info::init(const char *buf, const char *buf_end, bool use_new_format) { cached_new_format = use_new_format; if (use_new_format) Loading @@ -6093,12 +6094,11 @@ char *sql_ex_info::init(char *buf, char *buf_end, bool use_new_format) the case when we have old format because we will be reusing net buffer to read the actual file before we write out the Create_file event. */ const char *ptr= buf; if (read_str(&ptr, buf_end, (const char **) &field_term, &field_term_len) || read_str(&ptr, buf_end, (const char **) &enclosed, &enclosed_len) || read_str(&ptr, buf_end, (const char **) &line_term, &line_term_len) || read_str(&ptr, buf_end, (const char **) &line_start, &line_start_len) || read_str(&ptr, buf_end, (const char **) &escaped, &escaped_len)) if (read_str(&buf, buf_end, &field_term, &field_term_len) || read_str(&buf, buf_end, &enclosed, &enclosed_len) || read_str(&buf, buf_end, &line_term, &line_term_len) || read_str(&buf, buf_end, &line_start, &line_start_len) || read_str(&buf, buf_end, &escaped, &escaped_len)) return 0; opt_flags = *buf++; } Loading sql/log_event.h +6 −6 Original line number Diff line number Diff line Loading @@ -152,11 +152,11 @@ struct old_sql_ex struct sql_ex_info { sql_ex_info() {} /* Remove gcc warning */ char* field_term; char* enclosed; char* line_term; char* line_start; char* escaped; const char* field_term; const char* enclosed; const char* line_term; const char* line_start; const char* escaped; int cached_new_format; uint8 field_term_len,enclosed_len,line_term_len,line_start_len, escaped_len; char opt_flags; Loading @@ -171,7 +171,7 @@ struct sql_ex_info line_start_len + escaped_len + 6 : 7); } bool write_data(IO_CACHE* file); char* init(char* buf,char* buf_end,bool use_new_format); const char* init(const char* buf, const char* buf_end, bool use_new_format); bool new_format() { return ((cached_new_format != -1) ? cached_new_format : Loading Loading
mysql-test/suite/binlog/r/binlog_old_versions.result +10 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,16 @@ SELECT COUNT(*) FROM t3; COUNT(*) 17920 DROP TABLE t1, t2, t3; ==== Read binlog from version 4.1 ==== SELECT * FROM t1 ORDER BY a; a b 0 last_insert_id 4 four 190243 random SELECT COUNT(*) FROM t3; COUNT(*) 17920 DROP TABLE t1, t3; ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ==== SELECT * FROM t1 ORDER BY a; a b Loading
mysql-test/suite/binlog/std_data/binlog_old_version_4_1.000001 0 → 100644 +146 KiB File added.No diff preview for this file type. View file
mysql-test/suite/binlog/t/binlog_old_versions.test +15 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,21 @@ SELECT COUNT(*) FROM t3; DROP TABLE t1, t2, t3; --echo ==== Read binlog from version 4.1 ==== # In this version, neither row-based binlogging nor Xid events # existed, so the binlog was generated without the "row-based tests" # part and the "get xid event" part, and it does not create table t2. # Read binlog. --exec $MYSQL_BINLOG suite/binlog/std_data/binlog_old_version_4_1.000001 | $MYSQL # Show result. SELECT * FROM t1 ORDER BY a; SELECT COUNT(*) FROM t3; # Reset. DROP TABLE t1, t3; --echo ==== Read binlog from alcatel tree (mysql-5.1-wl2325-5.0-drop6) ==== # In this version, it was not possible to switch between row-based and Loading
sql/log_event.cc +12 −12 Original line number Diff line number Diff line Loading @@ -236,9 +236,9 @@ uint debug_not_change_ts_if_art_event= 1; // bug#29309 simulation */ #ifdef MYSQL_CLIENT static void pretty_print_str(IO_CACHE* cache, char* str, int len) static void pretty_print_str(IO_CACHE* cache, const char* str, int len) { char* end = str + len; const char* end = str + len; my_b_printf(cache, "\'"); while (str < end) { Loading Loading @@ -301,9 +301,9 @@ inline int ignored_error_code(int err_code) */ #if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) static char *pretty_print_str(char *packet, char *str, int len) static char *pretty_print_str(char *packet, const char *str, int len) { char *end= str + len; const char *end= str + len; char *pos= packet; *pos++= '\''; while (str < end) Loading Loading @@ -412,7 +412,7 @@ static void cleanup_load_tmpdir() write_str() */ static bool write_str(IO_CACHE *file, char *str, uint length) static bool write_str(IO_CACHE *file, const char *str, uint length) { uchar tmp[1]; tmp[0]= (uchar) length; Loading Loading @@ -6080,7 +6080,8 @@ bool sql_ex_info::write_data(IO_CACHE* file) sql_ex_info::init() */ char *sql_ex_info::init(char *buf, char *buf_end, bool use_new_format) const char *sql_ex_info::init(const char *buf, const char *buf_end, bool use_new_format) { cached_new_format = use_new_format; if (use_new_format) Loading @@ -6093,12 +6094,11 @@ char *sql_ex_info::init(char *buf, char *buf_end, bool use_new_format) the case when we have old format because we will be reusing net buffer to read the actual file before we write out the Create_file event. */ const char *ptr= buf; if (read_str(&ptr, buf_end, (const char **) &field_term, &field_term_len) || read_str(&ptr, buf_end, (const char **) &enclosed, &enclosed_len) || read_str(&ptr, buf_end, (const char **) &line_term, &line_term_len) || read_str(&ptr, buf_end, (const char **) &line_start, &line_start_len) || read_str(&ptr, buf_end, (const char **) &escaped, &escaped_len)) if (read_str(&buf, buf_end, &field_term, &field_term_len) || read_str(&buf, buf_end, &enclosed, &enclosed_len) || read_str(&buf, buf_end, &line_term, &line_term_len) || read_str(&buf, buf_end, &line_start, &line_start_len) || read_str(&buf, buf_end, &escaped, &escaped_len)) return 0; opt_flags = *buf++; } Loading
sql/log_event.h +6 −6 Original line number Diff line number Diff line Loading @@ -152,11 +152,11 @@ struct old_sql_ex struct sql_ex_info { sql_ex_info() {} /* Remove gcc warning */ char* field_term; char* enclosed; char* line_term; char* line_start; char* escaped; const char* field_term; const char* enclosed; const char* line_term; const char* line_start; const char* escaped; int cached_new_format; uint8 field_term_len,enclosed_len,line_term_len,line_start_len, escaped_len; char opt_flags; Loading @@ -171,7 +171,7 @@ struct sql_ex_info line_start_len + escaped_len + 6 : 7); } bool write_data(IO_CACHE* file); char* init(char* buf,char* buf_end,bool use_new_format); const char* init(const char* buf, const char* buf_end, bool use_new_format); bool new_format() { return ((cached_new_format != -1) ? cached_new_format : Loading