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/opt_index_cond_pushdown.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/opt_index_cond_pushdown.cc')
-rw-r--r-- | sql/opt_index_cond_pushdown.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/opt_index_cond_pushdown.cc b/sql/opt_index_cond_pushdown.cc index 43ad8494a74..848549c3b2d 100644 --- a/sql/opt_index_cond_pushdown.cc +++ b/sql/opt_index_cond_pushdown.cc @@ -192,7 +192,7 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno, if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC) { table_map used_tables= 0; - Item_cond_and *new_cond= new Item_cond_and(thd); + Item_cond_and *new_cond= new (thd->mem_root) Item_cond_and(thd); if (!new_cond) return (COND*) 0; List_iterator<Item> li(*((Item_cond*) cond)->argument_list()); @@ -227,7 +227,7 @@ static Item *make_cond_for_index(THD *thd, Item *cond, TABLE *table, uint keyno, } else /* It's OR */ { - Item_cond_or *new_cond= new Item_cond_or(thd); + Item_cond_or *new_cond= new (thd->mem_root) Item_cond_or(thd); if (!new_cond) return (COND*) 0; List_iterator<Item> li(*((Item_cond*) cond)->argument_list()); @@ -269,7 +269,7 @@ static Item *make_cond_remainder(THD *thd, Item *cond, TABLE *table, uint keyno, if (((Item_cond*) cond)->functype() == Item_func::COND_AND_FUNC) { /* Create new top level AND item */ - Item_cond_and *new_cond= new Item_cond_and(thd); + Item_cond_and *new_cond= new (thd->mem_root) Item_cond_and(thd); if (!new_cond) return (COND*) 0; List_iterator<Item> li(*((Item_cond*) cond)->argument_list()); @@ -297,7 +297,7 @@ static Item *make_cond_remainder(THD *thd, Item *cond, TABLE *table, uint keyno, } else /* It's OR */ { - Item_cond_or *new_cond= new Item_cond_or(thd); + Item_cond_or *new_cond= new (thd->mem_root) Item_cond_or(thd); if (!new_cond) return (COND*) 0; List_iterator<Item> li(*((Item_cond*) cond)->argument_list()); @@ -420,8 +420,8 @@ void push_index_cond(JOIN_TAB *tab, uint keyno) tab->select_cond= row_cond; else { - COND *new_cond= new Item_cond_and(tab->join->thd, row_cond, - idx_remainder_cond); + COND *new_cond= new (tab->join->thd->mem_root) + Item_cond_and(tab->join->thd, row_cond, idx_remainder_cond); tab->select_cond= new_cond; tab->select_cond->quick_fix_field(); ((Item_cond_and*)tab->select_cond)->used_tables_cache= |