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_update.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_update.cc')
-rw-r--r-- | sql/sql_update.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index ce211eca0e6..4f6371cc48f 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -148,7 +148,7 @@ static bool check_fields(THD *thd, List<Item> &items) we make temporary copy of Item_field, to avoid influence of changing result_field on Item_ref which refer on this field */ - thd->change_item_tree(it.ref(), new Item_field(thd, field)); + thd->change_item_tree(it.ref(), new (thd->mem_root) Item_field(thd, field)); } return FALSE; } @@ -1978,7 +1978,7 @@ loop_end: table to be updated was created by mysql 4.1. Deny this. */ field->can_alter_field_type= 0; - Item_field *ifield= new Item_field(join->thd, (Field *) field); + Item_field *ifield= new (thd->mem_root) Item_field(join->thd, (Field *) field); if (!ifield) DBUG_RETURN(1); ifield->maybe_null= 0; |