From 7eda171f9a9f17183335d53094a6e5f6ce5450cd Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Tue, 2 Dec 2003 16:49:46 +0100 Subject: There is no reason that Intvar_log_event's constructor calls Log_event::Log_event() instead of Log_event::Log_event(THD*, ...) when the event is built in the master to be written in the binlog. Rand_log_event already used the good constructor, so there really is no reason for Intvar_log_event to be an exception. This fixes a test failure of last night (which appeared after I removed a useless e.server_id=thd->server_id in log.cc; in fact this line was not useless because it hid the bad constructor). Replication tests pass, with Valgrind too. --- sql/log_event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/log_event.h') diff --git a/sql/log_event.h b/sql/log_event.h index 2e6b7373dc2..929d550951e 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -529,7 +529,7 @@ public: #ifndef MYSQL_CLIENT Intvar_log_event(THD* thd_arg,uchar type_arg, ulonglong val_arg) - :Log_event(),val(val_arg),type(type_arg) + :Log_event(thd_arg,0,0),val(val_arg),type(type_arg) {} void pack_info(String* packet); int exec_event(struct st_relay_log_info* rli); -- cgit v1.2.1 From dba12258b9e60ece0917b6907c5e07a2a1b62727 Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Mon, 8 Dec 2003 16:18:25 +0100 Subject: Fix for BUG#2045 "Sending SIGHUP to mysqld crashes it if running with --log-bin". The constructor of Rotate_log_event used when we are rotating our binlog or relay log, should not assume that there is a nonzero THD available. For example, when we are reacting to SIGHUP, the THD is 0. In fact we don't need to use the THD in this constructor; we can do like for Stop_log_event, and use the minimal Log_event constructor. If we were allowed to put Unix-specific commands in the testsuite, I'd add a test for this (). --- sql/log_event.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/log_event.h') diff --git a/sql/log_event.h b/sql/log_event.h index 929d550951e..a1a7798be34 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -607,7 +607,7 @@ public: Rotate_log_event(THD* thd_arg, const char* new_log_ident_arg, uint ident_len_arg = 0, ulonglong pos_arg = LOG_EVENT_OFFSET) - :Log_event(thd_arg,0,0), new_log_ident(new_log_ident_arg), + :Log_event(), new_log_ident(new_log_ident_arg), pos(pos_arg),ident_len(ident_len_arg ? ident_len_arg : (uint) strlen(new_log_ident_arg)), alloced(0) {} -- cgit v1.2.1