1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Window functions: make "ORDER BY window_func" work

- When window functions are present, JOIN::simple_order should be set
  to FALSE. (Otherwise, the optimizer may attempt to do a "pre-sorting"
  on the first join_tab. Which can work in some cases, but generally
  isn't)

- filesort tries to only read table fields that it requires. Window
  function requires its temp.table field.  In order to pass this info
  to filesort, added an implementation of Item_window_func::
  register_field_in_read_map.
This commit is contained in:
Sergei Petrunia
2016-04-08 03:21:25 +03:00
parent 59e5f5b47e
commit cb002d3479
4 changed files with 82 additions and 0 deletions

View File

@ -1846,6 +1846,7 @@ JOIN::optimize_inner()
//TODO this could probably go in test_if_need_tmp_table.
if (this->select_lex->window_specs.elements > 0) {
need_tmp= TRUE;
simple_order= FALSE;
}
/*