From be5a46a69b63eebfd4413e43a4f6a7b3c0c0bcd0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Feb 2008 14:44:47 +0100 Subject: Patch to eliminate some valgrind warnings in debug printout code. sql/rpl_rli.cc: Adding variable to mark an instance of Relay_log_info as fake. sql/rpl_rli.h: Adding variable to mark an instance of Relay_log_info as fake. sql/slave.cc: Not printing debug information if we are working with a fake instance of Relay_log_info. This because the result of calling update is nonsense, and trying to print it generates valgrind warnings. sql/sql_binlog.cc: Marking newly created instance of Relay_log_info as a fake instance. --- sql/slave.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 4ffc2023e85..c76e7c75a56 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1892,14 +1892,19 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli, if (exec_res == 0) { int error= ev->update_pos(rli); - char buf[22]; - DBUG_PRINT("info", ("update_pos error = %d", error)); - DBUG_PRINT("info", ("group %s %s", - llstr(rli->group_relay_log_pos, buf), - rli->group_relay_log_name)); - DBUG_PRINT("info", ("event %s %s", - llstr(rli->event_relay_log_pos, buf), - rli->event_relay_log_name)); +#ifdef HAVE_purify + if (!rli->is_fake) +#endif + { + char buf[22]; + DBUG_PRINT("info", ("update_pos error = %d", error)); + DBUG_PRINT("info", ("group %s %s", + llstr(rli->group_relay_log_pos, buf), + rli->group_relay_log_name)); + DBUG_PRINT("info", ("event %s %s", + llstr(rli->event_relay_log_pos, buf), + rli->event_relay_log_name)); + } /* The update should not fail, so print an error message and return an error code. @@ -1909,6 +1914,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli, */ if (error) { + char buf[22]; rli->report(ERROR_LEVEL, ER_UNKNOWN_ERROR, "It was not possible to update the positions" " of the relay log information: the slave may" -- cgit v1.2.1