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/handler.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/handler.cc')
-rw-r--r-- | sql/handler.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sql/handler.cc b/sql/handler.cc index 51deee44eb6..e2c24c7842a 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1983,10 +1983,14 @@ bool mysql_xa_recover(THD *thd) Protocol *protocol= thd->protocol; DBUG_ENTER("mysql_xa_recover"); - field_list.push_back(new Item_int("formatID", 0, MY_INT32_NUM_DECIMAL_DIGITS)); - field_list.push_back(new Item_int("gtrid_length", 0, MY_INT32_NUM_DECIMAL_DIGITS)); - field_list.push_back(new Item_int("bqual_length", 0, MY_INT32_NUM_DECIMAL_DIGITS)); - field_list.push_back(new Item_empty_string("data",XIDDATASIZE)); + field_list.push_back(new Item_int(thd, "formatID", 0, + MY_INT32_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_int(thd, "gtrid_length", 0, + MY_INT32_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_int(thd, "bqual_length", 0, + MY_INT32_NUM_DECIMAL_DIGITS)); + field_list.push_back(new Item_empty_string(thd, "data", + XIDDATASIZE)); if (protocol->send_result_set_metadata(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) @@ -5523,9 +5527,9 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) Protocol *protocol= thd->protocol; bool result; - field_list.push_back(new Item_empty_string("Type",10)); - field_list.push_back(new Item_empty_string("Name",FN_REFLEN)); - field_list.push_back(new Item_empty_string("Status",10)); + field_list.push_back(new Item_empty_string(thd, "Type", 10)); + field_list.push_back(new Item_empty_string(thd, "Name", FN_REFLEN)); + field_list.push_back(new Item_empty_string(thd, "Status", 10)); if (protocol->send_result_set_metadata(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) |