2713 Alexander Nozdrin 2008-12-25
Fix for Bug#41729: Valgrind warnings in setup_wild().
The problem is in the line below:
[sql_base.cc:setup_wild()]
select_lex->item_list= fields;
This assignment is translated to memcpy() call (at least on some
platforms). memcpy() expects that source and destination areas do not
overlap.
The fix is to do the assignment only if needed.
modified:
sql/sql_base.cc
2712 Jonathan Perkin 2008-12-17
Raise version number after cloning 6.0.9-alpha
modified:
configure.in
=== modified file 'sql/sql_base.cc'
--- a/sql/sql_base.cc 2008-12-14 11:36:15 +0000
+++ b/sql/sql_base.cc 2008-12-25 07:18:37 +0000
@@ -6524,7 +6524,14 @@ int setup_wild(THD *thd, TABLE_LIST *tab
/* make * substituting permanent */
SELECT_LEX *select_lex= thd->lex->current_select;
select_lex->with_wild= 0;
- select_lex->item_list= fields;
+
+ /*
+ The assignment below is translated to memcpy() call (at least on some
+ platforms). memcpy() expects that source and destination areas do not
+ overlap. That problem was detected by valgrind.
+ */
+ if (&select_lex->item_list != &fields)
+ select_lex->item_list= fields;
thd->restore_active_arena(arena, &backup);
}