summaryrefslogtreecommitdiff
path: root/mysql-test/r/win.result
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-9922: Assertion `!join->only_const_tables() && fsort' failedbb-10.2-mdev9543Sergei Petrunia2016-04-161-0/+9
| | | | | | When join output is just one row, we still need to compute window function values for it. We could skip invoking filesort for it, but it doesn't seem to be worth it to do such optimization.
* MDEV-9925: Wrong result with aggregate function as a window functionSergei Petrunia2016-04-151-0/+10
| | | | | | | | | | | Make Frame_range_current_row_bottom to take into account partition bounds. Other partition bounds that could potentially hit the end of partition are Frame_range_n_bottom, Frame_n_rows_following, Frame_unbounded_following, and they all had end-of-partition protection. To simplify the code, factored out end-of-partition checks into class Partition_read_cursor.
* Make test result deterministic.Sergei Petrunia2016-04-151-8/+8
|
* Fixed bug mdev-9897.Igor Babaev2016-04-141-0/+24
| | | | | | | This bug revealed a serious problem: if the same partition list was used in two window specifications then the temporary table created to calculate window functions contained fields for two identical partitions. This problem was fixed as well.
* Fix dense_rank returning minimum rank of 2 when using null columns.Vicențiu Ciorbaru2016-04-111-44/+0
| | | | | | The bug was caused by a weird behaviour in test_if_group_changed, not returning true when testing for the first time after initializing the Cached_item list.
* MDEV-9780: Window functions: interplay between window function and other ↵Sergei Petrunia2016-04-101-0/+58
| | | | | | | constructs Implement the "DISTINCT must not be converted into GROUP BY when window functions are present" part.
* MDEV-9895: Assertion `n_rows > 0' failed in Frame_cursor* get_frame_cursorSergei Petrunia2016-04-101-0/+61
| | | | | | | | | n=0 in "ROWS 0 PRECEDING" is valid, add handling for it: - Adjust the assert - Bottom bound of 'ROW 0 PRECEDING' is actually looking at the current row, that is, it needs to process partition's first row directly in Frame_n_rows_preceding::next_partition(). - Added testcases
* Window functions: return error if aggregate is not supported as window functionsSergei Petrunia2016-04-101-0/+10
|
* Window functions: handle window functions as arguments to other functionsSergei Petrunia2016-04-101-0/+19
| | | | | | | Window functions need to have their own column in the work (temp) table, like aggregate functions do. They don't need val_int() -> val_int_result() conversion though, so they should be wrapped with Item_direct_ref, not Item_aggregate_ref.
* Update to previous cset, which added ORDER BY into the wrong clauseSergei Petrunia2016-04-091-6/+6
|
* Make the testcase deterministicSergei Petrunia2016-04-081-3/+3
|
* Window functions: make "ORDER BY window_func" workSergei Petrunia2016-04-081-0/+45
| | | | | | | | | | | | - 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.
* MDEV-9877: Window functions: wrong sort criteria is usedSergei Petrunia2016-04-061-0/+52
| | | | | | | " The sort order for the sub-sequence of window functions starting from the element marked by SORTORDER_CHANGE_FLAG up to the next element marked by SORTORDER_CHANGE_FLAG must be taken from the last element of the sub-sequence (not from the first one)."
* MDEV-9847: Window functions: crash with big_tables=1Sergei Petrunia2016-04-061-0/+21
| | | | | - Move filesort's sort_positions argument into class Filesort. - Make window function code construct Filesort with sort_positions=true.
* MDEV-9848: Window functions: reuse sorting and/or scanningSergei Petrunia2016-04-051-0/+114
| | | | | | | - Rename Window_funcs_computation to Window_funcs_computation_step - Introduce Window_func_sort which invokes filesort and then invokes computation of all window functions that use this ordering. - Expose Window functions' sort operations in EXPLAIN|ANALYZE FORMAT=JSON
* The implementation of the template bubble_sort assumedIgor Babaev2016-04-011-0/+75
| | | | | | | | | | | | | | that the call-back comparison function returns a positive number when arg1 < arg2, and a negative number when arg1 > arg2. This is not in line with other implementation of sorting algorithm. Changed bubble_sort: now a negative result from the comparison function means that arg1 < arg2, and positive result means that arg1 > arg2. Changed accordingly all call-back functions that are used as parameters in the call of bubble_sort. Added a test case to check the proper sorting of window functions.
* Make EXPLAIN FORMAT=JSON be able to show the key that's used for sorting.Sergei Petrunia2016-03-301-0/+2
| | | | This will be useful for window functions development.
* MDEV-9787: Window functions: HAVING and GROUP BYSergei Petrunia2016-03-281-0/+29
| | | | | | - Hook window function computation into the right location. - Add a testcase which shows that HAVING is now checked before the window function computation step.
* Make window functions computation step show up in EXPLAIN FORMAT=JSON outputSergei Petrunia2016-03-281-0/+73
|
* Changed the base class for Item_window_func from Item_result_field toIgor Babaev2016-03-231-3/+46
| | | | | | | | | | Item_func_or_sum. Implemented method update_used_tables for class Item_findow_func. Added the flag Item::with_window_func. Made sure that window functions could be used only in SELECT list and ORDER BY clause. Added test cases that checked different illegal placements of window functions.
* For some window functions an order list must be present.Igor Babaev2016-03-181-0/+11
|
* MDEV-9724: Window functions: Frame Exclusion supportSergei Petrunia2016-03-181-0/+31
| | | | Produce a "not supported" error if one attempts to exclude rows
* Prohibit using window functions of some types withIgor Babaev2016-03-181-0/+19
| | | | window frames in full accordance with the SQL standard.
* Fixed bug mdev-9754.Igor Babaev2016-03-171-0/+40
| | | | Each window name has to be resolved only once.
* MDEV-9740: Window functions: catch invalid window frame specsSergei Petrunia2016-03-171-0/+38
| | | | Catch errors in window frame definitions
* Fixed the bug mdev-9719 concerning execution of prepared statementsIgor Babaev2016-03-161-0/+42
| | | | | | with window functions. Added the test case for it. Also allowed to use aliases for set functions in partition and order lists that are specified in window functions.
* Add testcases for frames with bound1 > bound2.Sergei Petrunia2016-03-161-0/+59
|
* Add a testcase for RANGE-type frames and NULL valuesSergei Petrunia2016-03-141-0/+32
|
* MDEV-9676: RANGE-type frames for window functionsSergei Petrunia2016-03-141-0/+110
| | | | | - Handle ORDER BY DESC in window definitions. - Fix an issue in Frame_range_current_row_top
* Add a testcase for non-integer range frame.Sergei Petrunia2016-03-131-0/+27
|
* MDEV-9676: RANGE-type frames for window functionsSergei Petrunia2016-03-131-0/+168
| | | | | | | Add support for "RANGE n PRECEDING|FOLLOWING" frame bounds. - n is currently limited to whatever Item and Item_sum_plus/minus can handle (i.e. no DATETIME intervals). - Didn't check NULL value handling yet.
* MDEV-9695: Wrong window frame when using RANGE BETWEEN N FOLLOWING AND PRECEDINGSergei Petrunia2016-03-111-0/+97
| | | | | | | | | | Part#2: Fix a couple more issues in rows-type frames. This also has a code cleanup: - introduce a separate Frame_rows_current_row_(top,bottom). This is is a special case which doesn't need its cursor or partition bound check - Split Frame_n_rows into = Frame_n_rows_preceding (this one is now much simpler) = Frame_n_rows_following (simpler and works but may need some work still)
* MDEV-9695: Wrong window frame when using RANGE BETWEEN N FOLLOWING AND PRECEDINGSergei Petrunia2016-03-101-0/+26
| | | | | | | Part#1: Frame_n_rows::next_partition() should not assume that the current table->record[0] points to the first row in the partition. Since cursor supports move_to() operation, we dont need this.
* MDEV-9676: RANGE-type frames for window functionsSergei Petrunia2016-03-061-0/+90
| | | | Add testcases for RANGE UNBOUNDED PRECEDING|FOLLOWING
* MDEV-9676: RANGE-type frames for window functionsSergei Petrunia2016-03-061-0/+108
| | | | Support RANGE ... CURRENT ROW as frame's first and second bound.
* MDEV-9634: Window function produces incorrect valueSergei Petrunia2016-02-261-0/+37
| | | | | | | | - Item_sum_count::remove() should check if the argument's value is NULL. - Window Function item must have its Item_window_func::split_sum_func called, - and it must call split_sum_func for aggregate's arguments (see the comment near Item_window_func::split_sum_func for explanation why)
* Fixed a problems in the parser.Igor Babaev2016-02-191-0/+170
| | | | | | Resolved window names. Checked some constraints for window frames. Added test cases for window name resolution.
* MDEV-9526: Compute Aggregate functions as window functionsSergei Petrunia2016-02-181-0/+117
| | | | | | | | | | - Add temporary code: clone_read_record() clones READ_RECORD structure, as long as it is used for reading filesort() result that fits into memory. - Add frame bounds for ROWS-type frames. ROWS n PRECEDING|FOLLOWING, ROWS UNBOUNDED PRECEDING|FOLLOWING, CURRENT ROW are supported. - Add Item_sum_count::remove() which allows "streaming" computation of COUNT() over a moving frame.
* Fix review comments.Vicențiu Ciorbaru2016-02-161-0/+1
|
* Implement DENSE_RANK function.Vicențiu Ciorbaru2016-02-161-0/+43
|
* Testcase fix and code cleanup for window functionsSergei Petrunia2016-02-151-1/+1
| | | | | - Make queries that use multiple window functions not to leak memory - Code cleanup in sql_window.cc
* Post-merge fixes. win.test passes but further cleanup is needed.Sergei Petrunia2016-02-141-1/+1
|
* More testcases, fixed commentsSergei Petrunia2016-02-141-3/+12
|
* Initial implementation of RANK() window functionSergei Petrunia2016-02-141-0/+44
|
* More testcases. Added .result fileSergei Petrunia2016-02-141-0/+41