summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-11-26 15:04:55 +0400
committerAlexander Barkov <bar@mariadb.org>2015-11-26 15:04:55 +0400
commitcc8e8633907427da0807734d99f2c5452d889c3c (patch)
treef518512ddbaedfc4d6a09d5c758884b82498c3a3 /sql
parentb50fa6dab2d2c00dc253ec9f22f3de9fec1105e9 (diff)
downloadmariadb-git-cc8e8633907427da0807734d99f2c5452d889c3c.tar.gz
Removing sp_variable::type, as it was always set to the same value with
sp_variable::field_def.type, so there was data redundancy.
Diffstat (limited to 'sql')
-rw-r--r--sql/item_xmlfunc.cc3
-rw-r--r--sql/sp_pcontext.h6
-rw-r--r--sql/sql_yacc.yy14
3 files changed, 10 insertions, 13 deletions
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index c1140946e87..ba17d2c48c3 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -2603,8 +2603,7 @@ my_xpath_parse_VariableReference(MY_XPATH *xpath)
(spv= spc->find_variable(name, false)))
{
Item_splocal *splocal= new (thd->mem_root)
- Item_splocal(thd, name, spv->offset,
- spv->type, 0);
+ Item_splocal(thd, name, spv->offset, spv->sql_type(), 0);
#ifndef DBUG_OFF
if (splocal)
splocal->m_sp= lex->sphead;
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index c15d6bc7016..2a080536b8a 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -43,9 +43,6 @@ public:
/// Name of the SP-variable.
LEX_STRING name;
- /// Field-type of the SP-variable.
- enum enum_field_types type;
-
/// Mode of the SP-variable.
enum_mode mode;
@@ -62,11 +59,12 @@ public:
/// Full type information (field meta-data) of the SP-variable.
Column_definition field_def;
+ /// Field-type of the SP-variable.
+ enum_field_types sql_type() const { return field_def.sql_type; }
public:
sp_variable(LEX_STRING _name, uint _offset)
:Sql_alloc(),
name(_name),
- type(MYSQL_TYPE_NULL),
mode(MODE_IN),
offset(_offset),
default_value(NULL)
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index a7744e83489..77877682ff9 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -435,7 +435,8 @@ set_local_variable(THD *thd, sp_variable *spv, Item *val)
sp_set= new (thd->mem_root)
sp_instr_set(lex->sphead->instructions(), lex->spcont,
- spv->offset, it, spv->type, lex, TRUE);
+ spv->offset, it, spv->sql_type(),
+ lex, TRUE);
return (sp_set == NULL || lex->sphead->add_instr(sp_set));
}
@@ -534,7 +535,8 @@ create_item_for_sp_var(THD *thd, LEX_STRING name, sp_variable *spvar,
len_in_q= end_in_q - start_in_q;
item= new (thd->mem_root)
- Item_splocal(thd, name, spvar->offset, spvar->type, pos_in_q, len_in_q);
+ Item_splocal(thd, name, spvar->offset, spvar->sql_type(),
+ pos_in_q, len_in_q);
#ifndef DBUG_OFF
if (item)
@@ -2942,7 +2944,6 @@ sp_param_name_and_type:
LEX *lex= Lex;
sp_variable *spvar= $<spvar>2;
- spvar->type= $3.field_type();
if (lex->sphead->fill_field_definition(thd, lex, lex->last_field))
{
MYSQL_YYABORT;
@@ -3060,7 +3061,6 @@ sp_decl:
if (!last)
spvar->field_def= *lex->last_field;
- spvar->type= $4.field_type();
spvar->default_value= dflt_value_item;
spvar->field_def.field_name= spvar->name.str;
@@ -11455,7 +11455,7 @@ limit_option:
if (spc && (spv = spc->find_variable($1, false)))
{
splocal= new (thd->mem_root)
- Item_splocal(thd, $1, spv->offset, spv->type,
+ Item_splocal(thd, $1, spv->offset, spv->sql_type(),
lip->get_tok_start() - lex->sphead->m_tmp_query,
lip->get_ptr() - lip->get_tok_start());
if (splocal == NULL)
@@ -11695,7 +11695,7 @@ select_outvar:
MYSQL_YYABORT;
}
$$ = Lex->result ? (new (thd->mem_root)
- my_var_sp($1, t->offset, t->type,
+ my_var_sp($1, t->offset, t->sql_type(),
Lex->sphead)) :
NULL;
}
@@ -13710,7 +13710,7 @@ simple_ident:
Item_splocal *splocal;
splocal= new (thd->mem_root)
- Item_splocal(thd, $1, spv->offset, spv->type,
+ Item_splocal(thd, $1, spv->offset, spv->sql_type(),
lip->get_tok_start_prev() - lex->sphead->m_tmp_query,
lip->get_tok_end() - lip->get_tok_start_prev());
if (splocal == NULL)