Commit c7a60de7 authored by Sergei Petrunia's avatar Sergei Petrunia

Code cleanup

parent 39d3cdbf
......@@ -545,6 +545,7 @@ class Item_window_func : public Item_func_or_sum
}
enum Item::Type type() const { return Item::WINDOW_FUNC_ITEM; }
private:
/*
Window functions are very special functions, so val_() methods have
special meaning for them:
......@@ -584,11 +585,6 @@ class Item_window_func : public Item_func_or_sum
read_value_from_result_field= true;
}
void set_read_value_from_result_field()
{
read_value_from_result_field= true;
}
double val_real()
{
double res;
......
......@@ -25898,7 +25898,7 @@ AGGR_OP::end_send()
// Update ref array
join_tab->join->set_items_ref_array(*join_tab->ref_array);
join->process_window_functions(&join->fields_list); // location #2
join->process_window_functions(&join->select_lex->window_funcs);
table->reginfo.lock_type= TL_UNLOCK;
bool in_first_read= true;
......
......@@ -1494,7 +1494,7 @@ class JOIN :public Sql_alloc
int init_execution();
void exec();
bool process_window_functions(List<Item> *curr_fields_list);
bool process_window_functions(List<Item_window_func> *window_funcs);
void exec_inner();
bool prepare_result(List<Item> **columns_list);
......
......@@ -1579,17 +1579,13 @@ bool compute_two_pass_window_functions(Item_window_func *item_win,
true Error
*/
bool JOIN::process_window_functions(List<Item> *curr_fields_list)
bool JOIN::process_window_functions(List<Item_window_func> *window_funcs)
{
List_iterator_fast<Item> it(*curr_fields_list);
Item *item;
List_iterator_fast<Item_window_func> it(*window_funcs);
Item_window_func *item_win;
while ((item_win= it++))
{
while ((item= it++))
{
if (item->type() == Item::WINDOW_FUNC_ITEM)
{
Item_window_func *item_win = (Item_window_func *) item;
item_win->set_phase_to_computation();
Window_spec *spec = item_win->window_spec;
/*
......@@ -1606,6 +1602,7 @@ bool JOIN::process_window_functions(List<Item> *curr_fields_list)
join_tab[top_join_tab_count].table is the temp. table where join
output was stored.
*/
// CAUTION: The sorting criteria list is not yet connected
add_sorting_to_table(&join_tab[top_join_tab_count],
spec->partition_list->first);
join_tab[top_join_tab_count].used_for_window_func= true;
......@@ -1674,8 +1671,6 @@ bool JOIN::process_window_functions(List<Item> *curr_fields_list)
if (is_error)
return true;
}
}
}
return false;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment