mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
keep old engine & JOIN if we changed subquery Item (Bug #3646)
mysql-test/r/subselect.result: ALL/ANY test mysql-test/t/subselect.test: ALL/ANY test sql/item_subselect.cc: keep old engine & JOIN if we changed subquery Item, which allow avoid second all SELECT items fix_fields call with pervios clean up (because of second setup_tables which remove table->key_use and maybe something else) keep list when we change Item in SELECT list processing inserted max/min function (now JOIN::prepare will be called only once) methods of changing item for subselect engines sql/item_subselect.h: change item & results procedure sql/item_sum.cc: Item_sum_hybrid::clear moved to .cc file (to keep .h clean and to make inserving/removing debug info easy) sql/item_sum.h: Item_sum_hybrid::clear moved to .cc file (to keep .h clean and to make inserving/removing debug info easy) sql/sql_lex.cc: note about new method sql/sql_lex.h: method for changing result of UNION JOINs sql/sql_select.cc: method for changing result in JOIN sql/sql_select.h: method for changing result in JOIN sql/sql_union.cc: method for changing result in JOIN
This commit is contained in:
@@ -555,3 +555,32 @@ void st_select_lex_unit::reinit_exec_mechanism()
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
change select_result object of unit
|
||||
|
||||
SYNOPSIS
|
||||
st_select_lex_unit::change_result()
|
||||
result new select_result object
|
||||
old_result old select_result object
|
||||
|
||||
RETURN
|
||||
0 - OK
|
||||
-1 - error
|
||||
*/
|
||||
|
||||
int st_select_lex_unit::change_result(select_subselect *result,
|
||||
select_subselect *old_result)
|
||||
{
|
||||
int res= 0;
|
||||
for (SELECT_LEX *sl= first_select_in_union(); sl; sl= sl->next_select())
|
||||
{
|
||||
if (sl->join && sl->join->result == old_result)
|
||||
if ((res= sl->join->change_result(result)))
|
||||
return (res);
|
||||
}
|
||||
if (fake_select_lex && fake_select_lex->join)
|
||||
res= fake_select_lex->join->change_result(result);
|
||||
return (res);
|
||||
}
|
||||
|
Reference in New Issue
Block a user