summaryrefslogtreecommitdiff
path: root/sql/item_windowfunc.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.4 into 10.5Marko Mäkelä2020-08-011-3/+7
|\
| * Merge 10.3 into 10.4Marko Mäkelä2020-07-311-3/+7
| |\
| | * Merge 10.2 into 10.3Marko Mäkelä2020-07-311-3/+7
| | |\
| | | * MDEV-9911: NTILE must return an error when parameter is not stableDan Solodko2020-07-281-3/+8
| | | |
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-07-151-1/+1
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-07-151-1/+1
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-07-141-1/+1
| | |\ \ | | | |/
| | | * MDEV-12059: Assertion `precision > 0' failed with a window function or ↵Varun Gupta2020-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | window aggregate function Pass the unsigned flag from the Item_sum to the window function
* | | | MDEV-20280 PERCENTILE_DISC() rejects temporal and string inputAlexander Barkov2020-06-011-1/+12
| | | |
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-12-271-68/+107
|\ \ \ \ | |/ / /
| * | | Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2019-12-251-68/+105
| |\ \ \ | | |/ /
| | * | MDEV-21392 Cleanup redundant overriding in Item_sum_numAlexander Barkov2019-12-251-68/+96
| | | |
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-08-161-1/+1
| |\ \ \ | | |/ /
| | * | MDEV-20351 Window function BIT_OR() OVER (..) return a wrong data typeAlexander Barkov2019-08-151-1/+1
| | | |
* | | | MDEV-20353 Add separate type handlers for unsigned integer data typesAlexander Barkov2019-08-151-3/+8
| | | |
* | | | Merge remote-tracking branch 'origin/10.4' into 10.5Alexander Barkov2019-08-131-19/+6
|\ \ \ \ | |/ / /
| * | | Merge commit '43882e764d6867c6855b1ff057758a3f08b25c55' into 10.4Alexander Barkov2019-08-131-19/+6
| |\ \ \ | | |/ /
| | * | A cleanup for `MDEV-20273 Add class Item_sum_min_max` - removing duplicate codeAlexander Barkov2019-08-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reusing the MIN()/MAX() fix_length_and_dec() related code for window functions - FIRST_VALUE() - LAST_VALUE() - NTH_VALUE() - LEAD() - LAG
| | * | MDEV-20278 PERCENTILE_DISC() returns a wrong data typeAlexander Barkov2019-08-071-11/+0
| | | |
| | * | MDEV-20273 Add class Item_sum_min_maxAlexander Barkov2019-08-071-10/+5
| | | |
* | | | MDEV-20052 Add a MEM_ROOT pointer argument to Type_handler::make_xxx_field()Alexander Barkov2019-07-121-1/+1
|/ / /
* | | Merge 10.3 into 10.4Marko Mäkelä2019-06-121-8/+4
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2019-06-111-8/+4
| |\ \ | | |/
| | * MDEV-18015: Assertion `global_status_var.global_memory_used == 0' failed ↵Varun Gupta2019-06-041-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | when using UDF , window functions and views Adding destructor for Group_bound_tracker to free Cached_item_str. The Cached_item for window functions are allocated on THD:mem_root but the Cached_item_str has value of type string which is allocated on the heap, so we need to call free() for it
* | | MDEV-19124 Assertion `0' failed in Item::val_nativeAlexander Barkov2019-04-021-0/+10
| | |
* | | A cleanup in Item_sum: removing dead codeAlexander Barkov2019-03-281-4/+4
| | |
* | | Merge 10.3 into 10.4Marko Mäkelä2018-10-171-0/+1
|\ \ \ | |/ /
| * | MDEV-17137: Syntax errors with VIEW using MEDIANVarun Gupta2018-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | The syntax error happened because we had not implemented a different print for percentile functions. The syntax is a bit different when we use percentile functions as window functions in comparision to normal window functions. Implemented a seperate print function for percentile functions
* | | MDEV-17317 Add THD* parameter into Item::get_date() and stricter data type ↵Alexander Barkov2018-09-281-3/+3
|/ / | | | | | | control to "fuzzydate"
* | Merge 10.2 into 10.3Marko Mäkelä2018-08-281-0/+2
|\ \ | |/
| * MDEV-15204: lag/lead function order list mandatoryzhzhzoo2018-08-251-0/+2
| |
* | Merge commit '6b8802e8dd5467556a024d807a1df23940b00895' into bb-10.3-fix_len_decbb-10.3-fix_len_decOleksandr Byelkin2018-06-191-5/+10
|\ \ | |/
| * MDEV-11071: Assertion `thd->transaction.stmt.is_empty()' failed in ↵Oleksandr Byelkin2018-06-151-3/+6
| | | | | | | | | | | | Locked_tables_list::unlock_locked_table fix_length_and_dec now return result (error/OK)
| * MDEV-13358: FIRST_V throw SQL Fehler (1292): Incorrect datetime valueVicențiu Ciorbaru2017-09-191-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is backport of 25ad623d64e for 10.2. The issue is similar to the one from MDEV-13240. Item::save_in_field() returns an error during tmp table population in a create table from select query as we try to save an empty string as a date value when force_return_blank is set to true for window functions. MDEV-13240 Wrong warning with MAX(datetime_field) OVER (...) The problem resided in Item_window_func implementation, and it was revealed by bb-10.2-ext specific changes: Item_window_func::save_in_field() works differently in bb-10.2-ext vs 10.2: - 10.2 goes through val_str() - bb-10.2-ext goes through get_date(), due to Type_handler related changes. get_date() tries to convert empty string to DATETIME, hence the warning. During a discussion with Vicentiu, it was decided to fix Item_window_func::val_xxx() to return NULL (instead of an "empty" value, such as 0 for numbers and '' for strings) when force_return_blank is set.
| * MDEV-12851: Case with window functions query crashes serverVicențiu Ciorbaru2017-06-281-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "is null" function performs one operation which no other Item_func does, which is to update used tables during fix_length_and_dec(). This however can not be performed before window functions have had a chance to resolve their order by and partition by definitions, which happens after the initial setup_fields call. Consequently, do not call Item_func_isnull update_used_tables during fix_length_and_dec(). There was another issue detected once the crash was resolved. Because window functions did not implement is_null() method, we would end up returning bad results for "is null" and "is not null" functions. Implemented is_null() method for Item_windowfunc.
* | Merge bb-10.2-ext into 10.3Marko Mäkelä2018-02-151-0/+24
|\ \
| * | MDEV-15293 CAST(AS TIME) returns bad results for ↵Alexander Barkov2018-02-131-0/+24
| | | | | | | | | | | | LAST_VALUE(),NAME_CONST(),SP variable
* | | Remove not used mem_root argument from build_clone(), get_copy() and ↵Michael Widenius2017-11-231-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | get_item_copy() TODO: - Make get_thd_memroot() inline - To do this, we need to reduce dependence of include files, especially so that sql_class.h is not depending in item.h
* | | Updates the tests for the percentile functionsVarun Gupta2017-11-011-7/+7
| | |
* | | Update the error messages involving percentile functionsVarun Gupta2017-11-011-4/+4
| | |
* | | Changes made according to the review given, mostly fixing coding style errorsVarun Gupta2017-11-011-8/+10
| | |
* | | Remove has_error as a member from Item_sum and use THD::is_error() insteadVicențiu Ciorbaru2017-11-011-6/+0
| | | | | | | | | | | | | | | Additionally, allow a query with window functions to be killed by the user during its execution.
* | | made changes according to the review, mostly removing unused code and fixing ↵Varun Gupta2017-11-011-28/+6
| | | | | | | | | | | | code to follow the coding conventions
* | | Added the errorVarun Gupta2017-11-011-32/+20
| | | | | | | | | | | | | | | | | | 1)ER_ARGUMENT_OUT_OF_RANGE: This error is thrown if the argument of the percentile function is not in the range [0,1] 2)ER_ARGUMENT_NOT_CONSTANT: This error is thrown if the argument of the percnetile function is not constant in the entire partition of the window function
* | | Added the function setting_handler_for_percentile_function() for the ↵Varun Gupta2017-11-011-0/+15
| | | | | | | | | | | | | | | | | | percentile_disc function that would set the type of the result field for percentile_disc. Percentile_cont would habe double precision result type
* | | Val_str function added for the percentile_disc function, as it can have ↵Varun Gupta2017-11-011-0/+11
| | | | | | | | | | | | result type as STRING_RESULT
* | | Percentile class implemented, most of the functions have the same ↵Varun Gupta2017-11-011-2/+159
| | | | | | | | | | | | functionalite as the percentile cont class
* | | Implemented the implementation of percentile functions using Item_cache ↵Varun Gupta2017-11-011-45/+37
| | | | | | | | | | | | instead of Cache_Item
* | | implementation of add() function added to the Item_sum_percentile_disc classVarun Gupta2017-11-011-8/+56
| | |
* | | Setting handler to have the return type as that of the element by which we ↵Varun Gupta2017-11-011-4/+8
| | | | | | | | | | | | are ordering the partition