From 1bae0d9e5669c2d03209082142e892417e24d09a Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 20 Aug 2015 15:24:13 +0300 Subject: 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 --- sql/sql_admin.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sql/sql_admin.cc') diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 4f78b1785a5..f8f5809d9c2 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -326,14 +326,14 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, DBUG_ENTER("mysql_admin_table"); DBUG_PRINT("enter", ("extra_open_options: %u", extra_open_options)); - field_list.push_back(item = new Item_empty_string(thd, "Table", + field_list.push_back(item= new (thd->mem_root) Item_empty_string(thd, "Table", NAME_CHAR_LEN * 2)); item->maybe_null = 1; - field_list.push_back(item = new Item_empty_string(thd, "Op", 10)); + field_list.push_back(item= new (thd->mem_root) Item_empty_string(thd, "Op", 10)); item->maybe_null = 1; - field_list.push_back(item = new Item_empty_string(thd, "Msg_type", 10)); + field_list.push_back(item= new (thd->mem_root) Item_empty_string(thd, "Msg_type", 10)); item->maybe_null = 1; - field_list.push_back(item = new Item_empty_string(thd, "Msg_text", + field_list.push_back(item= new (thd->mem_root) Item_empty_string(thd, "Msg_text", SQL_ADMIN_MSG_TEXT_SIZE)); item->maybe_null = 1; if (protocol->send_result_set_metadata(&field_list, -- cgit v1.2.1