diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-11-19 16:50:09 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-11-26 11:34:17 +0400 |
commit | 54689e1d5c358851c93d928c8ec453c929921f42 (patch) | |
tree | a52d829b99f79ffc1338947b95238eb12ab2dbd9 /sql/sql_acl.cc | |
parent | 753d1f868c0fd52c2ec44a97fe116c01a38d5ffd (diff) | |
download | mariadb-git-54689e1d5c358851c93d928c8ec453c929921f42.tar.gz |
MDEV-8715 - Obsolete sql_alloc() in favor of THD::alloc() and thd_alloc()
The following left in semi-improved state to keep patch size reasonable:
- Field operator new: left thd_alloc(current_thd)
- Sql_alloc operator new: left thd_alloc(thd_get_current_thd())
- Item_args constructors: left thd_alloc(thd)
- Item_func_interval::fix_length_and_dec(): no THD arg, have to call current_thd
- Item_func_dyncol_exists::val_int(): same
- Item_dyncol_get::val_str(): same
- Item_dyncol_get::val_int(): same
- Item_dyncol_get::val_real(): same
- Item_dyncol_get::val_decimal(): same
- Item_singlerow_subselect::fix_length_and_dec(): same
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 1240d5d35b2..eff54602536 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -6584,12 +6584,10 @@ bool grant_init() static bool grant_load(THD *thd, TABLE_LIST *tables) { - MEM_ROOT *memex_ptr; bool return_val= 1; TABLE *t_table, *c_table, *p_table; bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; - MEM_ROOT **save_mem_root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, - THR_MALLOC); + MEM_ROOT *save_mem_root= thd->mem_root; ulonglong old_sql_mode= thd->variables.sql_mode; DBUG_ENTER("grant_load"); @@ -6614,15 +6612,14 @@ static bool grant_load(THD *thd, TABLE_LIST *tables) t_table->use_all_columns(); c_table->use_all_columns(); - memex_ptr= &grant_memroot; - my_pthread_setspecific_ptr(THR_MALLOC, &memex_ptr); + thd->mem_root= &grant_memroot; if (!t_table->file->ha_index_first(t_table->record[0])) { do { GRANT_TABLE *mem_check; - if (!(mem_check=new (memex_ptr) GRANT_TABLE(t_table,c_table))) + if (!(mem_check= new (&grant_memroot) GRANT_TABLE(t_table, c_table))) { /* This could only happen if we are out memory */ goto end_unlock; @@ -6667,7 +6664,7 @@ static bool grant_load(THD *thd, TABLE_LIST *tables) { GRANT_NAME *mem_check; HASH *hash; - if (!(mem_check=new (memex_ptr) GRANT_NAME(p_table, TRUE))) + if (!(mem_check= new (&grant_memroot) GRANT_NAME(p_table, TRUE))) { /* This could only happen if we are out memory */ goto end_unlock_p; @@ -6720,7 +6717,7 @@ end_unlock_p: p_table->file->ha_index_end(); end_unlock: t_table->file->ha_index_end(); - my_pthread_setspecific_ptr(THR_MALLOC, save_mem_root_ptr); + thd->mem_root= save_mem_root; end_index_init: thd->variables.sql_mode= old_sql_mode; DBUG_RETURN(return_val); |