1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Sergey Vojtovich
2015-08-11 11:18:38 +04:00
parent 4374da63f0
commit 31e365efae
71 changed files with 2724 additions and 2474 deletions

View File

@ -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))