From cb9e8bcad80be8e65e3ad6b08d0632c967c982e3 Mon Sep 17 00:00:00 2001 From: "knielsen@ymer.(none)" <> Date: Mon, 5 Feb 2007 10:50:08 +0100 Subject: [PATCH] Fix false Valgrind warning. On some compiler/platform combination, an assignment of form *p= *p would map to a memcpy() call, and Valgrind flags this as an overlapped memcpy() error. Fix by prefixing *p= *q with if(p!=q) when building for Valgrind (HAVE_purify). --- sql/sql_select.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index dcf1f0cfc79..ea69eb72b51 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3520,7 +3520,11 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab, continue; } - *save_pos= *use; +#ifdef HAVE_purify + /* Valgrind complains about overlapped memcpy when save_pos==use. */ + if (save_pos != use) +#endif + *save_pos= *use; prev=use; found_eq_constant= !use->used_tables; /* Save ptr to first use */