diff options
author | Alexander Barkov <bar@mariadb.org> | 2018-01-31 19:49:48 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2018-01-31 19:49:48 +0400 |
commit | 1e5e3d562b867ae83c3fbb003465e1596c748690 (patch) | |
tree | ed46f2af6e264dc05e61cecf3aad7c4c61fc862b /sql/sp_head.cc | |
parent | df2d67824811516fabcfb09dacd6d147f8f71d54 (diff) | |
download | mariadb-git-1e5e3d562b867ae83c3fbb003465e1596c748690.tar.gz |
A cleanup in sp_rcontext, as requested by Monty
- Changing sp_rcontext::m_var_items from list of Item to list of Item_field
- Renaming sp_rcontext::get_item() to get_variable() and changing
its return type from Item* to Item_field *
- Adding sp_rcontext::get_parameter() and sp_rcontext::set_parameter(),
wrappers for get_variable() and set_variable() with extra DBUG_ASSERT.
Using new methods instead of get_variable()/set_variable() in
relevant places.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index ead04368acd..9351babdab5 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1700,7 +1700,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= nctx->set_variable(thd, arg_no, &(argp[arg_no])))) + if ((err_status= nctx->set_parameter(thd, arg_no, &(argp[arg_no])))) goto err_with_cleanup; } @@ -1732,7 +1732,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, if (arg_no) binlog_buf.append(','); - Item *item= nctx->get_item(arg_no); + Item_field *item= nctx->get_parameter(arg_no); str_value= item->type_handler()->print_item_value(thd, item, &str_value_holder); if (str_value) @@ -1948,7 +1948,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; @@ -1957,7 +1957,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; @@ -2065,7 +2065,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; @@ -2073,7 +2073,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; @@ -4116,7 +4116,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); /* |