From 31e365efae28ba3208e80511c4d18fe11a79541a Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 11 Aug 2015 11:18:38 +0400 Subject: 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. --- sql/sql_error.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sql/sql_error.cc') diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 3e18b701031..e0776a661bc 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -818,9 +818,10 @@ bool mysqld_show_warnings(THD *thd, ulong levels_to_show) DBUG_ASSERT(thd->get_stmt_da()->is_warning_info_read_only()); - field_list.push_back(new Item_empty_string("Level", 7)); - field_list.push_back(new Item_return_int("Code",4, MYSQL_TYPE_LONG)); - field_list.push_back(new Item_empty_string("Message",MYSQL_ERRMSG_SIZE)); + field_list.push_back(new Item_empty_string(thd, "Level", 7)); + field_list.push_back(new Item_return_int(thd, "Code", 4, MYSQL_TYPE_LONG)); + field_list.push_back(new Item_empty_string(thd, "Message", + MYSQL_ERRMSG_SIZE)); if (thd->protocol->send_result_set_metadata(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) -- cgit v1.2.1