From 5b85d0a75b209bb0f9ce8a4a1aca962f40cda5be Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Wed, 6 Apr 2016 18:24:11 +0300 Subject: [PATCH] Window functions: Better class names As discussed on the call: - s/Window_funcs_computation_step/Window_funcs_computation/g - s/Window_func_sort/Window_funcs_sort/g --- sql/sql_explain.h | 2 +- sql/sql_select.cc | 2 +- sql/sql_select.h | 2 +- sql/sql_window.cc | 28 ++++++++++++++-------------- sql/sql_window.h | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 3fdbd04c110..abdb1bb978b 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -311,7 +311,7 @@ public: enum_explain_aggr_node_type get_type() { return AGGR_OP_WINDOW_FUNCS; } void print_json_members(Json_writer *writer, bool is_analyze); - friend class Window_funcs_computation_step; + friend class Window_funcs_computation; }; ///////////////////////////////////////////////////////////////////////////// diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5fdab511855..b51f9fbf119 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2661,7 +2661,7 @@ bool JOIN::make_aggr_tables_info() curr_tab= join_tab + top_join_tab_count + aggr_tables - 1; if (select_lex->window_funcs.elements) { - curr_tab->window_funcs_step= new Window_funcs_computation_step; + curr_tab->window_funcs_step= new Window_funcs_computation; if (curr_tab->window_funcs_step->setup(thd, &select_lex->window_funcs, curr_tab)) DBUG_RETURN(true); diff --git a/sql/sql_select.h b/sql/sql_select.h index aa967a9ab6b..1718a4676f1 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -428,7 +428,7 @@ typedef struct st_join_table { Non-NULL value means this join_tab must do window function computation before reading. */ - Window_funcs_computation_step* window_funcs_step; + Window_funcs_computation* window_funcs_step; /** List of topmost expressions in the select list. The *next* JOIN TAB diff --git a/sql/sql_window.cc b/sql/sql_window.cc index 0aab45c3074..1a405ec198e 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -1798,7 +1798,7 @@ bool Window_func_runner::exec(TABLE *tbl, SORT_INFO *filesort_result) } -bool Window_func_sort::exec(JOIN *join) +bool Window_funcs_sort::exec(JOIN *join) { THD *thd= join->thd; JOIN_TAB *join_tab= &join->join_tab[join->top_join_tab_count]; @@ -1825,7 +1825,7 @@ bool Window_func_sort::exec(JOIN *join) } -bool Window_func_sort::setup(THD *thd, SQL_SELECT *sel, +bool Window_funcs_sort::setup(THD *thd, SQL_SELECT *sel, List_iterator &it) { Item_window_func *win_func= it.peek(); @@ -1854,7 +1854,7 @@ bool Window_func_sort::setup(THD *thd, SQL_SELECT *sel, } -bool Window_funcs_computation_step::setup(THD *thd, +bool Window_funcs_computation::setup(THD *thd, List *window_funcs, JOIN_TAB *tab) { @@ -1867,11 +1867,11 @@ bool Window_funcs_computation_step::setup(THD *thd, DBUG_ASSERT(!sel->quick); } - Window_func_sort *srt; + Window_funcs_sort *srt; List_iterator iter(*window_funcs); while (iter.peek()) { - if (!(srt= new Window_func_sort()) || + if (!(srt= new Window_funcs_sort()) || srt->setup(thd, sel, iter)) { return true; @@ -1882,10 +1882,10 @@ bool Window_funcs_computation_step::setup(THD *thd, } -bool Window_funcs_computation_step::exec(JOIN *join) +bool Window_funcs_computation::exec(JOIN *join) { - List_iterator it(win_func_sorts); - Window_func_sort *srt; + List_iterator it(win_func_sorts); + Window_funcs_sort *srt; /* Execute each sort */ while ((srt = it++)) { @@ -1896,10 +1896,10 @@ bool Window_funcs_computation_step::exec(JOIN *join) } -void Window_funcs_computation_step::cleanup() +void Window_funcs_computation::cleanup() { - List_iterator it(win_func_sorts); - Window_func_sort *srt; + List_iterator it(win_func_sorts); + Window_funcs_sort *srt; while ((srt = it++)) { srt->cleanup(); @@ -1909,12 +1909,12 @@ void Window_funcs_computation_step::cleanup() Explain_aggr_window_funcs* -Window_funcs_computation_step::save_explain_plan(MEM_ROOT *mem_root, +Window_funcs_computation::save_explain_plan(MEM_ROOT *mem_root, bool is_analyze) { Explain_aggr_window_funcs *xpl= new Explain_aggr_window_funcs; - List_iterator it(win_func_sorts); - Window_func_sort *srt; + List_iterator it(win_func_sorts); + Window_funcs_sort *srt; while ((srt = it++)) { Explain_aggr_filesort *eaf= diff --git a/sql/sql_window.h b/sql/sql_window.h index 045b97275a8..e109ef316ee 100644 --- a/sql/sql_window.h +++ b/sql/sql_window.h @@ -189,7 +189,7 @@ public: */ -class Window_func_sort : public Sql_alloc +class Window_funcs_sort : public Sql_alloc { List runners; @@ -200,7 +200,7 @@ public: bool exec(JOIN *join); void cleanup() { delete filesort; } - friend class Window_funcs_computation_step; + friend class Window_funcs_computation; }; @@ -215,9 +215,9 @@ class Explain_aggr_window_funcs; temporary table. */ -class Window_funcs_computation_step : public Sql_alloc +class Window_funcs_computation : public Sql_alloc { - List win_func_sorts; + List win_func_sorts; public: bool setup(THD *thd, List *window_funcs, st_join_table *tab); bool exec(JOIN *join);