Set type and default correctly for local SP variables during parsing.
sql/sql_yacc.yy: Set type and default correctly for local SP variables.
This commit is contained in:
parent
899ca897c1
commit
0026b6f46e
@ -1605,13 +1605,14 @@ sp_decl:
|
|||||||
for (uint i = max-$2 ; i < max ; i++)
|
for (uint i = max-$2 ; i < max ; i++)
|
||||||
{
|
{
|
||||||
sp_instr_set *in;
|
sp_instr_set *in;
|
||||||
|
uint off= ctx->pvar_context2index(i);
|
||||||
|
|
||||||
ctx->set_type(i, type);
|
ctx->set_type(off, type);
|
||||||
if (! has_default)
|
if (! has_default)
|
||||||
it= new Item_null(); /* QQ Set to the type with null_value? */
|
it= new Item_null(); /* QQ Set to the type with null_value? */
|
||||||
in = new sp_instr_set(lex->sphead->instructions(),
|
in = new sp_instr_set(lex->sphead->instructions(),
|
||||||
ctx,
|
ctx,
|
||||||
ctx->pvar_context2index(i),
|
off,
|
||||||
it, type, lex,
|
it, type, lex,
|
||||||
(i == max - 1));
|
(i == max - 1));
|
||||||
|
|
||||||
@ -1620,7 +1621,7 @@ sp_decl:
|
|||||||
freeing LEX.
|
freeing LEX.
|
||||||
*/
|
*/
|
||||||
lex->sphead->add_instr(in);
|
lex->sphead->add_instr(in);
|
||||||
ctx->set_default(i, it);
|
ctx->set_default(off, it);
|
||||||
}
|
}
|
||||||
lex->sphead->restore_lex(YYTHD);
|
lex->sphead->restore_lex(YYTHD);
|
||||||
$$.vars= $2;
|
$$.vars= $2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user