From 31e365efae28ba3208e80511c4d18fe11a79541a Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 11 Aug 2015 11:18:38 +0400 Subject: 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. --- sql/sql_parse.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_parse.h') diff --git a/sql/sql_parse.h b/sql/sql_parse.h index d85bb87a4fb..c3c47567cf5 100644 --- a/sql/sql_parse.h +++ b/sql/sql_parse.h @@ -108,7 +108,7 @@ bool append_file_to_dir(THD *thd, const char **filename_ptr, void execute_init_command(THD *thd, LEX_STRING *init_command, mysql_rwlock_t *var_lock); bool add_to_list(THD *thd, SQL_I_List &list, Item *group, bool asc); -void add_join_on(TABLE_LIST *b,Item *expr); +void add_join_on(THD *thd, TABLE_LIST *b, Item *expr); void add_join_natural(TABLE_LIST *a,TABLE_LIST *b,List *using_fields, SELECT_LEX *lex); bool add_proc_to_list(THD *thd, Item *item); @@ -118,7 +118,7 @@ bool push_new_name_resolution_context(THD *thd, void store_position_for_column(const char *name); void init_update_queries(void); bool check_simple_select(); -Item *normalize_cond(Item *cond); +Item *normalize_cond(THD *thd, Item *cond); Item *negate_expression(THD *thd, Item *expr); bool check_stack_overrun(THD *thd, long margin, uchar *dummy); -- cgit v1.2.1