mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
fixed subselect with to temporary tables executing
(now it return correct results. Test was commited before, but it is not pushed, BUG# is not registered, because bug was introduced after release) sql/sql_select.cc: fixed subselect with to temporary tables executing sql/sql_select.h: fixed subselect with to temporary tables executing
This commit is contained in:
parent
929a4783f1
commit
51b26a4d3f
2 changed files with 17 additions and 1 deletions
|
@ -1137,6 +1137,20 @@ JOIN::exec()
|
||||||
|
|
||||||
thd->proc_info="Copying to group table";
|
thd->proc_info="Copying to group table";
|
||||||
tmp_error= -1;
|
tmp_error= -1;
|
||||||
|
if (curr_join != this)
|
||||||
|
{
|
||||||
|
if (sum_funcs2)
|
||||||
|
{
|
||||||
|
curr_join->sum_funcs= sum_funcs2;
|
||||||
|
curr_join->sum_funcs_end= sum_funcs_end2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
curr_join->alloc_func_list();
|
||||||
|
sum_funcs2= curr_join->sum_funcs;
|
||||||
|
sum_funcs_end2= curr_join->sum_funcs_end;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (curr_join->make_sum_func_list(*curr_all_fields, *curr_fields_list,
|
if (curr_join->make_sum_func_list(*curr_all_fields, *curr_fields_list,
|
||||||
1) ||
|
1) ||
|
||||||
(tmp_error= do_select(curr_join, (List<Item> *) 0, curr_tmp_table,
|
(tmp_error= do_select(curr_join, (List<Item> *) 0, curr_tmp_table,
|
||||||
|
|
|
@ -146,6 +146,8 @@ class JOIN :public Sql_alloc
|
||||||
TABLE *exec_tmp_table1, *exec_tmp_table2;
|
TABLE *exec_tmp_table1, *exec_tmp_table2;
|
||||||
THD *thd;
|
THD *thd;
|
||||||
Item_sum **sum_funcs, ***sum_funcs_end;
|
Item_sum **sum_funcs, ***sum_funcs_end;
|
||||||
|
/* second copy of sumfuncs (for queries with 2 temporary tables */
|
||||||
|
Item_sum **sum_funcs2, ***sum_funcs_end2;
|
||||||
Procedure *procedure;
|
Procedure *procedure;
|
||||||
Item *having;
|
Item *having;
|
||||||
Item *tmp_having; // To store Having when processed temporary table
|
Item *tmp_having; // To store Having when processed temporary table
|
||||||
|
@ -199,7 +201,7 @@ class JOIN :public Sql_alloc
|
||||||
send_records(0), found_records(0), examined_rows(0),
|
send_records(0), found_records(0), examined_rows(0),
|
||||||
exec_tmp_table1(0), exec_tmp_table2(0),
|
exec_tmp_table1(0), exec_tmp_table2(0),
|
||||||
thd(thd_arg),
|
thd(thd_arg),
|
||||||
sum_funcs(0),
|
sum_funcs(0),sum_funcs2(0),
|
||||||
procedure(0),
|
procedure(0),
|
||||||
having(0), tmp_having(0),
|
having(0), tmp_having(0),
|
||||||
select_options(select_options_arg),
|
select_options(select_options_arg),
|
||||||
|
|
Loading…
Reference in a new issue