summaryrefslogtreecommitdiff
path: root/sql/item_row.h
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-08-11 11:18:38 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-08-21 10:40:39 +0400
commit31e365efae28ba3208e80511c4d18fe11a79541a (patch)
treef249682cc42490fc86382f5244a051001dc13c9e /sql/item_row.h
parent4374da63f03abc472f68f42e4e93261a18bfe417 (diff)
downloadmariadb-git-31e365efae28ba3208e80511c4d18fe11a79541a.tar.gz
MDEV-8010 - Avoid sql_alloc() in Items (Patch #1)
Added mandatory thd parameter to Item (and all derivative classes) constructor. Added thd parameter to all routines that may create items. Also removed "current_thd" from Item::Item. This reduced number of pthread_getspecific() calls from 290 to 177 per OLTP RO transaction.
Diffstat (limited to 'sql/item_row.h')
-rw-r--r--sql/item_row.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/item_row.h b/sql/item_row.h
index c5cbf0aff8b..0de547be327 100644
--- a/sql/item_row.h
+++ b/sql/item_row.h
@@ -35,10 +35,11 @@ class Item_row: public Item,
table_map not_null_tables_cache;
bool with_null;
public:
- Item_row(List<Item> &list)
- :Item_args(list), not_null_tables_cache(0), with_null(0)
+ Item_row(THD *thd, List<Item> &list):
+ Item(thd), Item_args(list), not_null_tables_cache(0), with_null(0)
{ }
- Item_row(Item_row *item):
+ Item_row(THD *thd, Item_row *item):
+ Item(thd),
Item_args(item),
Used_tables_and_const_cache(item),
not_null_tables_cache(0),
@@ -95,7 +96,7 @@ public:
return true;
return (this->*processor)(arg);
}
- Item *transform(Item_transformer transformer, uchar *arg);
+ Item *transform(THD *thd, Item_transformer transformer, uchar *arg);
bool eval_not_null_tables(uchar *opt_arg);
uint cols() { return arg_count; }