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 /plugin | |
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 'plugin')
-rw-r--r-- | plugin/feedback/feedback.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/plugin/feedback/feedback.cc b/plugin/feedback/feedback.cc index f1f4febc69e..a762522136e 100644 --- a/plugin/feedback/feedback.cc +++ b/plugin/feedback/feedback.cc @@ -99,20 +99,23 @@ static COND* make_cond(THD *thd, TABLE_LIST *tables, LEX_STRING *filter) nrc.init(); nrc.resolve_in_table_list_only(tables); - res= new Item_cond_or(thd); + res= new (thd->mem_root) Item_cond_or(thd); if (!res) return OOM; for (; filter->str; filter++) { - Item_field *fld= new Item_field(thd, &nrc, db, table, field); - Item_string *pattern= new Item_string(thd, filter->str, filter->length, cs); - Item_string *escape= new Item_string(thd, "\\", 1, cs); + Item_field *fld= new (thd->mem_root) Item_field(thd, &nrc, db, table, + field); + Item_string *pattern= new (thd->mem_root) Item_string(thd, filter->str, + filter->length, cs); + Item_string *escape= new (thd->mem_root) Item_string(thd, "\\", 1, cs); if (!fld || !pattern || !escape) return OOM; - Item_func_like *like= new Item_func_like(thd, fld, pattern, escape, 0); + Item_func_like *like= new (thd->mem_root) Item_func_like(thd, fld, pattern, + escape, 0); if (!like) return OOM; |