summaryrefslogtreecommitdiff
path: root/storage/sphinx
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 /storage/sphinx
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 'storage/sphinx')
-rw-r--r--storage/sphinx/ha_sphinx.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/storage/sphinx/ha_sphinx.cc b/storage/sphinx/ha_sphinx.cc
index a54930ec331..25cedf3547b 100644
--- a/storage/sphinx/ha_sphinx.cc
+++ b/storage/sphinx/ha_sphinx.cc
@@ -855,9 +855,9 @@ bool sphinx_show_status ( THD * thd )
}
CSphTLS * pTls = (CSphTLS*) thd->ha_data[sphinx_hton.slot];
- 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_fields ( &field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF ) )
SPH_RET(TRUE);
@@ -2337,8 +2337,8 @@ int ha_sphinx::write_row ( byte * )
{
if ( (*ppField)->type()==MYSQL_TYPE_TIMESTAMP )
{
- Item_field * pWrap = new Item_field ( *ppField ); // autofreed by query arena, I assume
- Item_func_unix_timestamp * pConv = new Item_func_unix_timestamp ( pWrap );
+ Item_field * pWrap = new Item_field ( ha_thd(), *ppField ); // autofreed by query arena, I assume
+ Item_func_unix_timestamp * pConv = new Item_func_unix_timestamp ( ha_thd(), pWrap );
pConv->quick_fix_field();
unsigned int uTs = (unsigned int) pConv->val_int();