mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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:
@ -1585,8 +1585,7 @@ mysql_select(THD *thd, Item ***rref_pointer_array,
|
||||
if (select_lex->linkage != GLOBAL_OPTIONS_TYPE)
|
||||
{
|
||||
//here is EXPLAIN of subselect or derived table
|
||||
join->result= result;
|
||||
if (!join->procedure && result->prepare(join->fields_list, unit))
|
||||
if (join->change_result(result))
|
||||
{
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
@ -9514,3 +9513,27 @@ void st_select_lex::print(THD *thd, String *str)
|
||||
|
||||
// PROCEDURE unsupported here
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
change select_result object of JOIN
|
||||
|
||||
SYNOPSIS
|
||||
JOIN::change_result()
|
||||
res new select_result object
|
||||
|
||||
RETURN
|
||||
0 - OK
|
||||
-1 - error
|
||||
*/
|
||||
|
||||
int JOIN::change_result(select_result *res)
|
||||
{
|
||||
DBUG_ENTER("JOIN::change_result");
|
||||
result= res;
|
||||
if (!procedure && result->prepare(fields_list, select_lex->master_unit()))
|
||||
{
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user