Commit graph

179547 commits

Author SHA1 Message Date
Igor Babaev
914e2c9ba8 Merge branch '10.3' of github.com:MariaDB/server into 10.3 2017-11-01 21:48:03 -07:00
Igor Babaev
6f1b6061d8 Merge remote-tracking branch 'shagalla/10.3-mdev12172' into 10.3
As a result of this merge the code for the following tasks appears in 10.3:
- MDEV-12172 Implement tables specified by table value constructors
- MDEV-12176 Transform [NOT] IN predicate with long list of values INTO
             [NOT] IN subquery.
2017-11-01 21:42:26 -07:00
Varun Gupta
a607e4e7aa Added the syntax for percentile functions and median function to the sql_yacc_ora.yy file 2017-11-01 23:17:15 +05:30
Varun Gupta
ab5503c8c5 Updates the tests for the percentile functions 2017-11-01 23:17:15 +05:30
Varun Gupta
40887913ff Update the error messages involving percentile functions 2017-11-01 23:17:15 +05:30
Varun Gupta
0ef6127c29 Date-time fields are disabled currently for the result type of percentile function 2017-11-01 23:17:15 +05:30
Varun Gupta
58a6e43513 Tests added for percentile and median functions 2017-11-01 23:17:14 +05:30
Varun Gupta
b77105cab6 Only single element order-by list is allowed for percentile functions 2017-11-01 23:17:14 +05:30
Varun Gupta
4f4f8f3fb1 Added the median function to the parser , it should behave as a percentile_cont function with its argument fixed to 0.5 2017-11-01 23:17:14 +05:30
Varun Gupta
02a4a4b512 Added fix_fields for percentile function to check the type of argument and to ensure that only numeric arguments are allowed 2017-11-01 23:17:14 +05:30
Varun Gupta
b5c104d00a Changes made according to the review given, mostly fixing coding style errors 2017-11-01 23:16:59 +05:30
Vicențiu Ciorbaru
24e219b179 Remove has_error as a member from Item_sum and use THD::is_error() instead
Additionally, allow a query with window functions to be killed by the user during
its execution.
2017-11-01 23:13:02 +05:30
Varun Gupta
f4ba298abd Fixed indentation in the syntax rules for the sql_yacc.yy , also added the rules of the percentile functions to
the sql_yacc_ora.yy
2017-11-01 23:13:02 +05:30
Varun Gupta
f8e135c7df made changes according to the review, mostly removing unused code and fixing code to follow the coding conventions 2017-11-01 23:13:02 +05:30
Varun Gupta
f04426f727 Added more tests for the percentile functions 2017-11-01 23:13:01 +05:30
Varun Gupta
03ed22326a Added the error
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
2017-11-01 23:13:01 +05:30
Varun Gupta
6511069e7f Added the error ER_WRONG_TYPE_FOR_PERCENTILE_CONT, which ensures that the result type for percentile_cont is always numerical 2017-11-01 23:13:01 +05:30
Varun Gupta
947ce922c9 Added the error ER_NOT_SINGLE_ELEMENT_ORDER_LIST for th percentile functions, these ensure that for the percentile
function we have the order list with exactly one element
2017-11-01 23:13:01 +05:30
Varun Gupta
96565ac311 Added the function setting_handler_for_percentile_function() for the percentile_disc function that would
set the type of the result field for percentile_disc. Percentile_cont would habe double precision result type
2017-11-01 23:13:01 +05:30
Varun Gupta
330577988f has_error field added to the item_sum class. This field ensures that query is terminated
if we get any error during the add function call. This is currently used only for the
percentile functions
2017-11-01 23:13:01 +05:30
Varun Gupta
64a2a30295 Error codes added for the percentile functions, the errors are
-ER_NOT_SINGLE_ELEMENT_ORDER_LIST
  -ER_WRONG_TYPE_FOR_PERCENTILE_CONT
  -ER_ARGUMENT_NOT_CONSTANT
  -ER_ARGUMENT_OUT_OF_RANGE
2017-11-01 23:13:01 +05:30
Varun Gupta
eb2187a24f Val_str function added for the percentile_disc function, as it can have result type as STRING_RESULT 2017-11-01 23:13:01 +05:30
Varun Gupta
3393005e95 Ensured that the the element in the order by clause should have a numerical time, if not throw an error 2017-11-01 23:13:01 +05:30
Varun Gupta
275ce39f05 Percentile class implemented, most of the functions have the same functionalite as the percentile cont class 2017-11-01 23:13:01 +05:30
Varun Gupta
01d2b6e9d9 Implemented the implementation of percentile functions using Item_cache instead of Cache_Item 2017-11-01 23:13:01 +05:30
Varun Gupta
d2214da4d0 Test case added for the percentile disc function 2017-11-01 23:13:01 +05:30
Varun Gupta
ba9fbc6a83 implementation of add() function added to the Item_sum_percentile_disc class 2017-11-01 23:13:01 +05:30
Varun Gupta
c85552f42b Added a class Frame_unbounded_following_set_count_special, which is required to ignore
all the null values while calculating the number of rows in the partition
2017-11-01 23:13:01 +05:30
Varun Gupta
31f1541f1e Setting handler to have the return type as that of the element by which we are ordering the partition 2017-11-01 23:13:01 +05:30
Varun Gupta
cc046fa92c A basic implementation of the add function is added 2017-11-01 23:13:01 +05:30
Varun Gupta
18747a4baa Added value field to Item_sum_percentile_disc
Check for single element in the order_list is added
2017-11-01 23:13:01 +05:30
Varun Gupta
129626f171 Added get_item() to Cached_item_item and get_value to the Cached_item 2017-11-01 23:13:01 +05:30
Varun Gupta
280945bf29 MDEV-12985: support percentile and median window functions
Finalised the synatax and have started implementing the class for the PERCENTILE_DISC
2017-11-01 23:13:01 +05:30
Varun Gupta
fadfe447e8 MDEV-12985: syntax added for the percentile_cont and percentile_disc functions 2017-11-01 23:13:01 +05:30
Vladislav Vaintroub
29c4bd9d27 SOURCE_REVISION should always be defined in source_revision.h
#cmakedefine in template file might not create a #define in configured
header file.
2017-11-01 13:20:32 +00:00
Sergey Vojtovich
613dd62a76 MDEV-11153 - Introduce status variables for table cache monitoring and tuning
Status variables added: Table_open_cache_hits, Table_open_cache_misses,
Table_open_cache_overflows, Table_open_cache_active_instances.
2017-10-31 19:13:20 +04:00
Alexander Barkov
5d3ed9acdd (Part#2) MDEV-13049 Querying INFORMATION_SCHEMA becomes slow in MariaDB 10.1
This is a 10.3 specific part of MDEV-13049.
It disables automatic sorting for
"SELECT .. FROM INFORMATION_SCHEMA.{SCHEMATA|TABLES}"
and adjusts the affected tests accordingly.
2017-10-31 13:00:20 +04:00
Alexander Barkov
835cbbcc7b Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
TODO: enable MDEV-13049 optimization for 10.3
2017-10-30 20:47:39 +04:00
Alexander Barkov
003cb2f424 Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext 2017-10-30 16:42:46 +04:00
Alexey Botchkov
fe8cf8fdf1 Embedded tests fixed. 2017-10-30 16:06:42 +04:00
Galina Shalygina
34737e0cee trigger.result corrected 2017-10-30 13:16:15 +02:00
Marko Mäkelä
58e0dcb93d Add a missing space to an error message 2017-10-30 10:06:47 +02:00
Alexander Barkov
84ed288f68 MDEV-13997 Change Item_bool_rowready_func2 to cache const items at fix time rather than evaluation time
Side effect: the second debug Note in cache_temporal_4265.result disappeared.

Before this change:
- During JOIN::cache_const_exprs(),
  Item::get_cache() for Item_date_add_interval() was called.
  The data type for date_add('2001-01-01',interval 5 day) is VARCHAR,
  because the first argument is VARCHAR (not temporal).
  Item_get_cache() created Item_cache_str('2001-01-06').
- During evaluate_join_record(), get_datetime_value() was called,
  which called Item::get_date() for Item_cache_str('2001-01-06').
  This gave the second Note. Then, get_datetime_value() created
  a new cache, now Item_cache_temporal for '2001-01-06', so not
  further str_to_datetime() happened.

After this change:
- During tem_bool_rowready_func2::fix_length_and_dec(),
  Arg_comparator::set_cmp_func_datetime() is called,
  which immediately creates an instance of Item_cache_date for
  the result of date_add('2001-01-01',interval 5 day).
  So later no str_to_datetime happens any more,
  neither during JOIN::cache_const_exprs(),
  nor during evaluate_join_record().
2017-10-30 09:26:38 +04:00
Alexander Barkov
667e4b97aa MDEV-14212 Add Field_row for SP ROW variables 2017-10-30 09:24:39 +04:00
Alexey Botchkov
f88fcf2514 MDEV-12542 Add bind_address system variable.
bind_address variable added.
2017-10-30 07:37:25 +04:00
Elena Stepanova
de6bfbd5e9 Updated list of unstable tests for 10.2.10 2017-10-30 03:25:49 +02:00
Elena Stepanova
a269173e97 Workaround for MDEV-13852 (tests don't run on Windows) 2017-10-30 03:24:35 +02:00
Sergei Petrunia
7cca0df0d7 Fix rocksdb.rocksdb test
Forgot to put the updated rocksdb.result in
2017-10-29 22:55:51 +03:00
Galina Shalygina
43625a31cb Mistakes corrected. Test results corrected. 2017-10-29 21:09:07 +02:00
Sergei Petrunia
e5678c3fac MDEV-13904: rocksdb.add_index_inplace_sstfilewriter timed out
Downscale rocksdb.add_index_inplace_sstfilewriter to be 10x smaller
2017-10-29 13:21:23 +03:00