1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +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

@ -3482,7 +3482,7 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
while ((item= li++))
{
item->transform(&Item::update_value_transformer,
item->transform(thd, &Item::update_value_transformer,
(uchar*)lex->current_select);
}
}
@ -3950,9 +3950,10 @@ static TABLE *create_table_from_items(THD *thd,
(Item ***) 0, &tmp_field, &def_field, 0, 0, 0, 0,
0);
if (!field ||
!(cr_field=new Create_field(field,(item->type() == Item::FIELD_ITEM ?
((Item_field *)item)->field :
(Field*) 0))))
!(cr_field=new Create_field(thd, field,
(item->type() == Item::FIELD_ITEM ?
((Item_field *) item)->field :
(Field *) 0))))
DBUG_RETURN(0);
if (item->maybe_null)
cr_field->flags &= ~NOT_NULL_FLAG;