diff options
author | Monty <monty@mariadb.org> | 2015-08-20 15:24:13 +0300 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-08-21 10:40:51 +0400 |
commit | 1bae0d9e5669c2d03209082142e892417e24d09a (patch) | |
tree | 8702469bab1f515c78a06ede07ae4aeaa297c802 /sql/sql_error.cc | |
parent | 31e365efae28ba3208e80511c4d18fe11a79541a (diff) | |
download | mariadb-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_error.cc')
-rw-r--r-- | sql/sql_error.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/sql_error.cc b/sql/sql_error.cc index e0776a661bc..f7eb6dd6a1f 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -814,13 +814,15 @@ const LEX_STRING warning_level_names[]= bool mysqld_show_warnings(THD *thd, ulong levels_to_show) { List<Item> field_list; + MEM_ROOT *mem_root= thd->mem_root; DBUG_ENTER("mysqld_show_warnings"); DBUG_ASSERT(thd->get_stmt_da()->is_warning_info_read_only()); - field_list.push_back(new Item_empty_string(thd, "Level", 7)); - field_list.push_back(new Item_return_int(thd, "Code", 4, MYSQL_TYPE_LONG)); - field_list.push_back(new Item_empty_string(thd, "Message", + field_list.push_back(new (mem_root) Item_empty_string(thd, "Level", 7)); + field_list.push_back(new (mem_root) Item_return_int(thd, "Code", 4, + MYSQL_TYPE_LONG)); + field_list.push_back(new (mem_root) Item_empty_string(thd, "Message", MYSQL_ERRMSG_SIZE)); if (thd->protocol->send_result_set_metadata(&field_list, |