summaryrefslogtreecommitdiff
path: root/sql/sql_profile.cc
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/sql_profile.cc
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/sql_profile.cc')
-rw-r--r--sql/sql_profile.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_profile.cc b/sql/sql_profile.cc
index a21cca5449a..0f29add7079 100644
--- a/sql/sql_profile.cc
+++ b/sql/sql_profile.cc
@@ -390,11 +390,12 @@ bool PROFILING::show_profiles()
QUERY_PROFILE *prof;
List<Item> field_list;
- field_list.push_back(new Item_return_int("Query_ID", 10,
+ field_list.push_back(new Item_return_int(thd, "Query_ID", 10,
MYSQL_TYPE_LONG));
- field_list.push_back(new Item_return_int("Duration", TIME_FLOAT_DIGITS-1,
+ field_list.push_back(new Item_return_int(thd, "Duration",
+ TIME_FLOAT_DIGITS - 1,
MYSQL_TYPE_DOUBLE));
- field_list.push_back(new Item_empty_string("Query", 40));
+ field_list.push_back(new Item_empty_string(thd, "Query", 40));
if (thd->protocol->send_result_set_metadata(&field_list,
Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))