summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2015-08-20 15:24:13 +0300
committerSergey Vojtovich <svoj@mariadb.org>2015-08-21 10:40:51 +0400
commit1bae0d9e5669c2d03209082142e892417e24d09a (patch)
tree8702469bab1f515c78a06ede07ae4aeaa297c802 /sql/sql_union.cc
parent31e365efae28ba3208e80511c4d18fe11a79541a (diff)
downloadmariadb-git-1bae0d9e5669c2d03209082142e892417e24d09a.tar.gz
Stage 2 of MDEV-6152:
- Added mem_root to all calls to new Item - Added private method operator new(size_t size) to Item to ensure that we always use a mem_root when creating an item. This saves use once call to current_thd per Item creation
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 80c576bb993..356f68693bd 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -342,6 +342,7 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
bool is_union_select;
bool instantiate_tmp_table= false;
DBUG_ENTER("st_select_lex_unit::prepare");
+ DBUG_ASSERT(thd == thd_arg && thd == current_thd);
describe= MY_TEST(additional_options & SELECT_DESCRIBE);
@@ -484,7 +485,8 @@ bool st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
while ((item_tmp= it++))
{
/* Error's in 'new' will be detected after loop */
- types.push_back(new Item_type_holder(thd_arg, item_tmp));
+ types.push_back(new (thd_arg->mem_root)
+ Item_type_holder(thd_arg, item_tmp));
}
if (thd_arg->is_fatal_error)