summaryrefslogtreecommitdiff
path: root/sql/sql_window.h
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2018-11-01 08:55:16 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-11-01 21:15:55 +0200
commit1c6b982e02eeaa75bb6c2f2a3c2b64491dd6d3c8 (patch)
treedd639542380856235c0d38ede1c184f148f7dff9 /sql/sql_window.h
parentdd6e74c62a2aa44d9d5e1790bcd36d3ff1c7d98b (diff)
downloadmariadb-git-1c6b982e02eeaa75bb6c2f2a3c2b64491dd6d3c8.tar.gz
MDEV-12779 Oracle/DB2 Compatibility Implicit Ordering for ROW_NUMBER OVER
Users expect window functions to produce a certain ordering of rows in the final result set. Although the standard does not require this, we already have the filesort result done for when we computed the window function. If there is no ORDER BY attached to the query, just keep it till the SELECT is completely evaluated and use that to print the result. Update test cases as many did not take care to guarantee a stable result.
Diffstat (limited to 'sql/sql_window.h')
-rw-r--r--sql/sql_window.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_window.h b/sql/sql_window.h
index 6a56fc84392..e0c1563e5bb 100644
--- a/sql/sql_window.h
+++ b/sql/sql_window.h
@@ -195,7 +195,7 @@ class Window_funcs_sort : public Sql_alloc
public:
bool setup(THD *thd, SQL_SELECT *sel, List_iterator<Item_window_func> &it,
st_join_table *join_tab);
- bool exec(JOIN *join);
+ bool exec(JOIN *join, bool keep_filesort_result);
void cleanup() { delete filesort; }
friend class Window_funcs_computation;
@@ -225,7 +225,7 @@ class Window_funcs_computation : public Sql_alloc
List<Window_funcs_sort> win_func_sorts;
public:
bool setup(THD *thd, List<Item_window_func> *window_funcs, st_join_table *tab);
- bool exec(JOIN *join);
+ bool exec(JOIN *join, bool keep_last_filesort_result);
Explain_aggr_window_funcs *save_explain_plan(MEM_ROOT *mem_root, bool is_analyze);
void cleanup();