Bug #46003 and bug #46034: backported the fixes from azalea.

This commit is contained in:
Georgi Kodinov 2009-07-16 15:19:22 +03:00
commit 7a91bf8c91
3 changed files with 26 additions and 9 deletions

View file

@ -5095,7 +5095,13 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
/* 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);
}