summaryrefslogtreecommitdiff
path: root/sql/sql_profile.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_profile.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_profile.cc')
-rw-r--r--sql/sql_profile.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index 0f29add7079..28ceccc695a 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -121,7 +121,7 @@ int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table)
continue;
field_info= &schema_table->fields_info[i];
- Item_field *field= new Item_field(thd, context,
+ Item_field *field= new (thd->mem_root) Item_field(thd, context,
NullS, NullS, field_info->field_name);
if (field)
{
@@ -389,13 +389,14 @@ bool PROFILING::show_profiles()
DBUG_ENTER("PROFILING::show_profiles");
QUERY_PROFILE *prof;
List<Item> field_list;
+ MEM_ROOT *mem_root= thd->mem_root;
- field_list.push_back(new Item_return_int(thd, "Query_ID", 10,
+ field_list.push_back(new (mem_root) Item_return_int(thd, "Query_ID", 10,
MYSQL_TYPE_LONG));
- field_list.push_back(new Item_return_int(thd, "Duration",
+ field_list.push_back(new (mem_root) Item_return_int(thd, "Duration",
TIME_FLOAT_DIGITS - 1,
MYSQL_TYPE_DOUBLE));
- field_list.push_back(new Item_empty_string(thd, "Query", 40));
+ field_list.push_back(new (mem_root) Item_empty_string(thd, "Query", 40));
if (thd->protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))