diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-08-11 11:18:38 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-08-21 10:40:39 +0400 |
commit | 31e365efae28ba3208e80511c4d18fe11a79541a (patch) | |
tree | f249682cc42490fc86382f5244a051001dc13c9e /sql/sql_analyse.cc | |
parent | 4374da63f03abc472f68f42e4e93261a18bfe417 (diff) | |
download | mariadb-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/sql_analyse.cc')
-rw-r--r-- | sql/sql_analyse.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 32b447797cf..e9f43a50fce 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -1166,23 +1166,23 @@ int collect_ulonglong(ulonglong *element, } // collect_ulonglong -bool analyse::change_columns(List<Item> &field_list) +bool analyse::change_columns(THD *thd, List<Item> &field_list) { field_list.empty(); - func_items[0] = new Item_proc_string("Field_name", 255); - func_items[1] = new Item_proc_string("Min_value", 255); + func_items[0] = new Item_proc_string(thd, "Field_name", 255); + func_items[1] = new Item_proc_string(thd, "Min_value", 255); func_items[1]->maybe_null = 1; - func_items[2] = new Item_proc_string("Max_value", 255); + func_items[2] = new Item_proc_string(thd, "Max_value", 255); func_items[2]->maybe_null = 1; - func_items[3] = new Item_proc_int("Min_length"); - func_items[4] = new Item_proc_int("Max_length"); - func_items[5] = new Item_proc_int("Empties_or_zeros"); - func_items[6] = new Item_proc_int("Nulls"); - func_items[7] = new Item_proc_string("Avg_value_or_avg_length", 255); - func_items[8] = new Item_proc_string("Std", 255); + func_items[3] = new Item_proc_int(thd, "Min_length"); + func_items[4] = new Item_proc_int(thd, "Max_length"); + func_items[5] = new Item_proc_int(thd, "Empties_or_zeros"); + func_items[6] = new Item_proc_int(thd, "Nulls"); + func_items[7] = new Item_proc_string(thd, "Avg_value_or_avg_length", 255); + func_items[8] = new Item_proc_string(thd, "Std", 255); func_items[8]->maybe_null = 1; - func_items[9] = new Item_proc_string("Optimal_fieldtype", + func_items[9] = new Item_proc_string(thd, "Optimal_fieldtype", MY_MAX(64, output_str_length)); for (uint i = 0; i < array_elements(func_items); i++) |