summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2015-11-19 16:50:09 +0400
committerSergey Vojtovich <svoj@mariadb.org>2015-11-26 11:34:17 +0400
commit54689e1d5c358851c93d928c8ec453c929921f42 (patch)
treea52d829b99f79ffc1338947b95238eb12ab2dbd9 /sql/sql_parse.cc
parent753d1f868c0fd52c2ec44a97fe116c01a38d5ffd (diff)
downloadmariadb-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_parse.cc')
-rw-r--r--sql/sql_parse.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index efec0c42b22..52dcc7ee5d6 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -858,7 +858,7 @@ end:
}
-/* This works because items are allocated with sql_alloc() */
+/* This works because items are allocated on THD::mem_root */
void free_items(Item *item)
{
@@ -873,7 +873,7 @@ void free_items(Item *item)
}
/**
- This works because items are allocated with sql_alloc().
+ This works because items are allocated on THD::mem_root.
@note The function also handles null pointers (empty list).
*/
void cleanup_items(Item *item)
@@ -2099,7 +2099,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
{
DBUG_RETURN(1);
}
- schema_select_lex= new SELECT_LEX();
+ schema_select_lex= new (thd->mem_root) SELECT_LEX();
db.str= schema_select_lex->db= lex->select_lex.db;
schema_select_lex->table_list.first= NULL;
db.length= strlen(db.str);
@@ -2122,7 +2122,7 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
#else
DBUG_ASSERT(table_ident);
TABLE_LIST **query_tables_last= lex->query_tables_last;
- schema_select_lex= new SELECT_LEX();
+ schema_select_lex= new (thd->mem_root) SELECT_LEX();
/* 'parent_lex' is used in init_query() so it must be before it. */
schema_select_lex->parent_lex= lex;
schema_select_lex->init_query();