diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-05-12 22:14:59 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-05-12 22:14:59 +0300 |
commit | 15419a558370aeed9521b498c34d50f20a8d47a5 (patch) | |
tree | cd15d32e9b61f297d8fafb048df85d9148951eb2 /sql | |
parent | 5e84ea9634ac491f3da84f6c15987d4c1b1a5a3a (diff) | |
parent | 77867c147b8a278977203ad33d7daff0587a112a (diff) | |
download | mariadb-git-15419a558370aeed9521b498c34d50f20a8d47a5.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysqld.h | 2 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/sql_select.h | 9 | ||||
-rw-r--r-- | sql/sql_window.cc | 2 |
4 files changed, 12 insertions, 3 deletions
diff --git a/sql/mysqld.h b/sql/mysqld.h index 2e829e81a0d..4a392eaf196 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -241,7 +241,7 @@ extern int max_user_connections; extern volatile ulong cached_thread_count; extern ulong what_to_log,flush_time; extern uint max_prepared_stmt_count, prepared_stmt_count; -extern ulong open_files_limit; +extern MYSQL_PLUGIN_IMPORT ulong open_files_limit; extern ulonglong binlog_cache_size, binlog_stmt_cache_size, binlog_file_cache_size; extern ulonglong max_binlog_cache_size, max_binlog_stmt_cache_size; extern ulong max_binlog_size; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2728bae429a..f658b78c33c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3227,7 +3227,7 @@ bool JOIN::make_aggr_tables_info() - duplicate value removal Both of these operations are done after window function computation step. */ - curr_tab= join_tab + exec_join_tab_cnt() + aggr_tables - 1; + curr_tab= join_tab + total_join_tab_cnt(); if (select_lex->window_funcs.elements) { if (!(curr_tab->window_funcs_step= new Window_funcs_computation)) diff --git a/sql/sql_select.h b/sql/sql_select.h index f8911fbba01..5e202e50152 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -1571,6 +1571,15 @@ public: /* Number of tables actually joined at the top level */ uint exec_join_tab_cnt() { return tables_list ? top_join_tab_count : 0; } + /* + Number of tables in the join which also includes the temporary tables + created for GROUP BY, DISTINCT , WINDOW FUNCTION etc. + */ + uint total_join_tab_cnt() + { + return exec_join_tab_cnt() + aggr_tables - 1; + } + int prepare(TABLE_LIST *tables, uint wind_num, COND *conds, uint og_num, ORDER *order, bool skip_order_by, ORDER *group, Item *having, ORDER *proc_param, SELECT_LEX *select, diff --git a/sql/sql_window.cc b/sql/sql_window.cc index 025a56ae239..38fdd8ab80b 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -2931,7 +2931,7 @@ bool Window_func_runner::exec(THD *thd, TABLE *tbl, SORT_INFO *filesort_result) bool Window_funcs_sort::exec(JOIN *join) { THD *thd= join->thd; - JOIN_TAB *join_tab= join->join_tab + join->exec_join_tab_cnt(); + JOIN_TAB *join_tab= join->join_tab + join->total_join_tab_cnt(); /* Sort the table based on the most specific sorting criteria of the window functions. */ |