summaryrefslogtreecommitdiff
path: root/sql/sql_get_diagnostics.cc
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 /sql/sql_get_diagnostics.cc
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 'sql/sql_get_diagnostics.cc')
-rw-r--r--sql/sql_get_diagnostics.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_get_diagnostics.cc b/sql/sql_get_diagnostics.cc
index 8b0d86aa7d1..b6c215d29b1 100644
--- a/sql/sql_get_diagnostics.cc
+++ b/sql/sql_get_diagnostics.cc
@@ -174,7 +174,7 @@ Statement_information_item::get_value(THD *thd, const Diagnostics_area *da)
case NUMBER:
{
ulong count= da->cond_count();
- value= new (thd->mem_root) Item_uint(count);
+ value= new (thd->mem_root) Item_uint(thd, count);
break;
}
/*
@@ -183,7 +183,7 @@ Statement_information_item::get_value(THD *thd, const Diagnostics_area *da)
REPLACE, LOAD).
*/
case ROW_COUNT:
- value= new (thd->mem_root) Item_int(thd->get_row_count_func());
+ value= new (thd->mem_root) Item_int(thd, thd->get_row_count_func());
break;
}
@@ -270,7 +270,7 @@ Condition_information_item::make_utf8_string_item(THD *thd, const String *str)
String tmp(str->ptr(), str->length(), from_cs);
/* If necessary, convert the string (ignoring errors), then copy it over. */
uint conv_errors;
- return new Item_string(&tmp, to_cs, &conv_errors,
+ return new Item_string(thd, &tmp, to_cs, &conv_errors,
DERIVATION_COERCIBLE, MY_REPERTOIRE_UNICODE30);
}
@@ -329,7 +329,7 @@ Condition_information_item::get_value(THD *thd, const Sql_condition *cond)
value= make_utf8_string_item(thd, &(cond->m_message_text));
break;
case MYSQL_ERRNO:
- value= new (thd->mem_root) Item_uint(cond->m_sql_errno);
+ value= new (thd->mem_root) Item_uint(thd, cond->m_sql_errno);
break;
case RETURNED_SQLSTATE:
str.set_ascii(cond->get_sqlstate(), strlen(cond->get_sqlstate()));