summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2018-02-04 18:40:06 +0400
committerAlexander Barkov <bar@mariadb.org>2018-02-04 18:40:06 +0400
commit217fc122c8e893aa48fa5dcfb3dbfcc99a2aa299 (patch)
tree83093666c427b4770d82c0ff44f0d7034bec13a8 /sql/sp_head.cc
parentd6ed077fc82c2f4d20895db9a6b16ca295f23c33 (diff)
parent28d4cf0c1b3366c6471866d144ef28fced1e5390 (diff)
downloadmariadb-git-217fc122c8e893aa48fa5dcfb3dbfcc99a2aa299.tar.gz
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 2387429ea79..d451f25db8a 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -471,7 +471,8 @@ sp_head::operator new(size_t size) throw()
MEM_ROOT own_root;
sp_head *sp;
- init_sql_alloc(&own_root, MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC, MYF(0));
+ init_sql_alloc(&own_root, "sp_head",
+ MEM_ROOT_BLOCK_SIZE, MEM_ROOT_PREALLOC, MYF(0));
sp= (sp_head *) alloc_root(&own_root, size);
if (sp == NULL)
DBUG_RETURN(NULL);
@@ -999,7 +1000,8 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
thd->select_number+= m_select_number;
/* init per-instruction memroot */
- init_sql_alloc(&execute_mem_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
+ init_sql_alloc(&execute_mem_root, "per_instruction_memroot",
+ MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
DBUG_ASSERT(!(m_flags & IS_INVOKED));
m_flags|= IS_INVOKED;
@@ -1520,7 +1522,6 @@ sp_head::execute_trigger(THD *thd,
MEM_ROOT call_mem_root;
Query_arena call_arena(&call_mem_root, Query_arena::STMT_INITIALIZED_FOR_SP);
Query_arena backup_arena;
-
DBUG_ENTER("sp_head::execute_trigger");
DBUG_PRINT("info", ("trigger %s", m_name.str));
@@ -1576,7 +1577,8 @@ sp_head::execute_trigger(THD *thd,
TODO: we should create sp_rcontext once per command and reuse it
on subsequent executions of a trigger.
*/
- init_sql_alloc(&call_mem_root, MEM_ROOT_BLOCK_SIZE, 0, MYF(0));
+ init_sql_alloc(&call_mem_root, "execute_trigger", MEM_ROOT_BLOCK_SIZE, 0,
+ MYF(0));
thd->set_n_backup_active_arena(&call_arena, &backup_arena);
Row_definition_list defs;
@@ -1713,7 +1715,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
/* Arguments must be fixed in Item_func_sp::fix_fields */
DBUG_ASSERT(argp[arg_no]->fixed);
- if ((err_status= (*func_ctx)->set_variable(thd, arg_no, &(argp[arg_no]))))
+ if ((err_status= (*func_ctx)->set_parameter(thd, arg_no, &(argp[arg_no]))))
goto err_with_cleanup;
}
@@ -1745,7 +1747,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
if (arg_no)
binlog_buf.append(',');
- Item *item= (*func_ctx)->get_item(arg_no);
+ Item_field *item= (*func_ctx)->get_parameter(arg_no);
str_value= item->type_handler()->print_item_value(thd, item,
&str_value_holder);
if (str_value)
@@ -1958,7 +1960,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
Item *tmp_item= null_item;
if (!null_item ||
- nctx->set_variable(thd, i, &tmp_item))
+ nctx->set_parameter(thd, i, &tmp_item))
{
DBUG_PRINT("error", ("set variable failed"));
err_status= TRUE;
@@ -1967,7 +1969,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
}
else
{
- if (nctx->set_variable(thd, i, it_args.ref()))
+ if (nctx->set_parameter(thd, i, it_args.ref()))
{
DBUG_PRINT("error", ("set variable 2 failed"));
err_status= TRUE;
@@ -2095,7 +2097,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
DBUG_ASSERT(srp);
- if (srp->set_value(thd, octx, nctx->get_item_addr(i)))
+ if (srp->set_value(thd, octx, nctx->get_variable_addr(i)))
{
DBUG_PRINT("error", ("set value failed"));
err_status= TRUE;
@@ -2103,7 +2105,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
}
Send_field *out_param_info= new (thd->mem_root) Send_field();
- nctx->get_item(i)->make_field(thd, out_param_info);
+ nctx->get_parameter(i)->make_field(thd, out_param_info);
out_param_info->db_name= m_db.str;
out_param_info->table_name= m_name.str;
out_param_info->org_table_name= m_name.str;
@@ -4204,7 +4206,7 @@ sp_instr_cursor_copy_struct::exec_core(THD *thd, uint *nextp)
{
DBUG_ENTER("sp_instr_cursor_copy_struct::exec_core");
int ret= 0;
- Item_field_row *row= (Item_field_row*) thd->spcont->get_item(m_var);
+ Item_field_row *row= (Item_field_row*) thd->spcont->get_variable(m_var);
DBUG_ASSERT(row->type_handler() == &type_handler_row);
/*