summaryrefslogtreecommitdiff
path: root/sql/set_var.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/set_var.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/set_var.h')
-rw-r--r--sql/set_var.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/set_var.h b/sql/set_var.h
index 0215a452c07..e559f6bf810 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -285,7 +285,7 @@ public:
} save_result;
LEX_STRING base; /**< for structured variables, like keycache_name.variable_name */
- set_var(enum_var_type type_arg, sys_var *var_arg,
+ set_var(THD *thd, enum_var_type type_arg, sys_var *var_arg,
const LEX_STRING *base_name_arg, Item *value_arg)
:var(var_arg), type(type_arg), base(*base_name_arg)
{
@@ -296,7 +296,8 @@ public:
if (value_arg && value_arg->type() == Item::FIELD_ITEM)
{
Item_field *item= (Item_field*) value_arg;
- if (!(value=new Item_string_sys(item->field_name))) // names are utf8
+ // names are utf8
+ if (!(value=new Item_string_sys(thd, item->field_name)))
value=value_arg; /* Give error message later */
}
else