summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-07-16 15:19:22 +0300
committerGeorgi Kodinov <joro@sun.com>2009-07-16 15:19:22 +0300
commit7a91bf8c9131e3622684684b6e45c0282c4701e3 (patch)
tree18d02a3d7da5b6416dfea8ec55df6cbe2e7ce30f /sql/sql_base.cc
parentc80fc3501b525999140b82367b71728dfd059f89 (diff)
downloadmariadb-git-7a91bf8c9131e3622684684b6e45c0282c4701e3.tar.gz
Bug #46003 and bug #46034: backported the fixes from azalea.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 0f86a3dd311..56ab50835b6 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -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);
}