Commit e3ddf925 authored by unknown's avatar unknown
Browse files

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:
  Fix false valgrind warning.
parent 2b39a66d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -3520,6 +3520,10 @@ update_ref_and_keys(THD *thd, DYNAMIC_ARRAY *keyuse,JOIN_TAB *join_tab,
	  continue;
      }

#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;