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_table.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 453239e3bf9..0bf42a862f3 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -9626,9 +9626,9 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, */ DBUG_ASSERT(! thd->in_sub_stmt); - field_list.push_back(item = new Item_empty_string(thd, "Table", NAME_LEN*2)); + field_list.push_back(item= new (thd->mem_root) Item_empty_string(thd, "Table", NAME_LEN*2)); item->maybe_null= 1; - field_list.push_back(item= new Item_int(thd, "Checksum", + field_list.push_back(item= new (thd->mem_root) Item_int(thd, "Checksum", (longlong) 1, MY_INT64_NUM_DECIMAL_DIGITS)); item->maybe_null= 1; -- cgit v1.2.1