1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fix for BUG#1495: Evaluate items before setting a local variable with SELECT INTO.

Also copy and restore order_list and group_list for selects in SPs.


mysql-test/r/sp.result:
  Test for BUG#1495, and an additional cursor test.
mysql-test/t/sp.test:
  Test for BUG#1495, and an additional cursor test.
sql/sp_head.cc:
  Fix BUG#1495: renamed eval_func_item() into sp_eval_func_item() and made it
  non-static.
  Also need to copy and restore order_list and group_list pointers before and
  after execution of a substatement. (Which means these must always be properly
  initialized for all queries.)
sql/sp_rcontext.cc:
  Fix BUG#1495: Evaluate and set a local variable (for SELECT INTO).
sql/sp_rcontext.h:
  Fix BUG#1495: Evaluate and set a local variable (for SELECT INTO).
sql/sql_class.cc:
  Fix BUG#1495: Evaluate and set a local variable (for SELECT INTO).
sql/sql_class.h:
  Fix BUG#1495: Evaluate and set a local variable (for SELECT INTO); need type for this.
sql/sql_parse.cc:
  order_list and group_list must be initialized in select_lex for all queries,
  to make SP sub statement execution work.
sql/sql_yacc.yy:
  Type needed for setting local variables.
sql/table.h:
  Need a copy of the Item* pointer when executing sub-statements in SPs. (Since
  it's modified and must be restored afterwards.)
This commit is contained in:
unknown
2003-10-14 12:59:28 +02:00
parent 569e72af7d
commit 776784b821
10 changed files with 176 additions and 18 deletions

View File

@@ -1137,7 +1137,7 @@ bool select_dumpvar::send_data(List<Item> &items)
{
if ((yy=var_li++))
{
thd->spcont->set_item(yy->get_offset(), item);
thd->spcont->set_item_eval(yy->get_offset(), item, zz->type);
}
}
else