Fixed BUG#2776: Stored procedure crash if variable assigned to default.

Keep track on the default value and use it. (Or NULL, if not declared.)


mysql-test/r/sp.result:
  New testcases for BUG#2776.
mysql-test/t/sp.test:
  New testcases for BUG#2776.
sql/sp_pcontext.cc:
  Initialize local variable default value.
sql/sp_pcontext.h:
  New method for saving default value.
sql/sql_yacc.yy:
  If DEFAULT is use as a value in SET variable = ... in an SP, actually use the default.
This commit is contained in:
unknown 2004-04-06 15:48:58 +02:00
commit c22ccc136b
5 changed files with 75 additions and 3 deletions

View file

@ -118,6 +118,7 @@ sp_pcontext::push_pvar(LEX_STRING *name, enum enum_field_types type,
p->mode= mode;
p->offset= m_pvar.elements;
p->isset= (mode == sp_param_out ? FALSE : TRUE);
p->dflt= NULL;
insert_dynamic(&m_pvar, (gptr)&p);
}
}