mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +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:
@@ -1123,7 +1123,10 @@ public:
|
||||
LEX_STRING s;
|
||||
bool local;
|
||||
uint offset;
|
||||
my_var (LEX_STRING& j, bool i, uint o) : s(j), local(i), offset(o) {}
|
||||
enum_field_types type;
|
||||
my_var (LEX_STRING& j, bool i, uint o, enum_field_types t)
|
||||
:s(j), local(i), offset(o), type(t)
|
||||
{}
|
||||
~my_var() {}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user