summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorunknown <knielsen@ymer.(none)>2007-02-05 10:50:08 +0100
committerunknown <knielsen@ymer.(none)>2007-02-05 10:50:08 +0100
commite3ddf9259a637096ca6440ef7867923b32821d72 (patch)
tree3d0cac3e32a0680e6b000e1785520a999fb10f5b /sql/sql_select.cc
parent2b39a66d80e0daba593b506456042649b087843c (diff)
downloadmariadb-git-e3ddf9259a637096ca6440ef7867923b32821d72.tar.gz
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.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc6
1 files changed, 5 insertions, 1 deletions
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 */