summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.cc
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.4 into 10.5Marko Mäkelä2020-10-301-0/+2
|\
| * Merge 10.3 into 10.4Marko Mäkelä2020-10-291-0/+2
| |\
| | * Merge 10.2 into 10.3Marko Mäkelä2020-10-281-0/+2
| | |\
| | | * MDEV-20593 SIGSEGV in report_json_error_ex (on optimized builds).Alexey Botchkov2020-10-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | When first argument to the JSON_MERGE_PATCH was NULL and second - the invalid JSON line, the error code was garbage. So it should be set to 0 initially.
* | | | MDEV-23437 Item_func_json_objectagg::print is not implemented.Alexey Botchkov2020-10-241-4/+2
| | | | | | | | | | | | | | | | Fix the Item_func_json_objectagg::fix_fields to save the orig_args.
* | | | Merge 10.4 into 10.5Marko Mäkelä2020-07-021-0/+35
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2020-07-021-0/+35
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Marko Mäkelä2020-07-021-0/+35
| | |\ \ | | | |/
| | | * MDEV-22976 CAST(JSON_EXTRACT() AS DECIMAL) does not handle boolean valuesAlexander Barkov2020-06-221-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Item_func_json_extract did not implement val_decimal(), so CAST(JSON_EXTRACT('{"x":true}', '$.x') AS DECIMAL) erroneously returned 0 with a warning because of convertion from the string "true" to decimal. Implementing val_decimal(), so boolean values are correctly handled.
* | | | MDEV-23029: JSON_OBJECTAGG returns NULL when used together with GROUP BYVarun Gupta2020-06-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quick grouping is not supported for JSON_OBJECTAGG. The same for GROUP_CONCAT too so make sure that Item::quick_group is set to FALSE. We need to make sure that in the case of JSON_OBJECTAGG we don't create an index over grouping fields of the temp table and update the result after each iteration. Instead we should first sort the result in accordance to the GROUP BY fields and then perform the grouping and write the result to the temp table.
* | | | MDEV-22844 JSON_ARRAYAGG is limited by group_concat_max_len.Alexey Botchkov2020-06-151-0/+18
| | | | | | | | | | | | | | | | Warning message and function result fixed
* | | | MDEV-22011: DISTINCT with JSON_ARRAYAGG gives wrong resultsVarun Gupta2020-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For DISTINCT to be handled with JSON_ARRAYAGG, we need to make sure that the Unique tree also holds the NULL bytes of a table record inside the node of the tree. This behaviour for JSON_ARRAYAGG is different from GROUP_CONCAT because in GROUP_CONCAT we just reject NULL values for columns. Also introduced a comparator function for the unique tree to handle null values for distinct inside JSON_ARRAYAGG.
* | | | MDEV-21914 JSON_ARRAYAGG doesn't reject ORDER BY clause, but doesn't work ↵Alexey Botchkov2020-06-041-3/+62
| | | | | | | | | | | | | | | | | | | | | | | | either. ORDER BY fixed for JSON_ARRAYAGG.
* | | | MDEV-22640, MDEV-22449, MDEV-21528 JSON_ARRAYAGG crashes with NULL values.Alexey Botchkov2020-06-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | We have to include NULL in the result which the GOUP_CONCAT doesn't always do. Also converting should be done into another String instance as these can be same.
* | | | MDEV-22236 JSON_ARRAYAGG query leads to SIGSEGV in Charset::swap on ↵Alexey Botchkov2020-04-281-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | optimized builds. The json_arrayagg::val_str should handle NULL result.
* | | | MDEV-21581 Helper functions and methods for CHARSET_INFOAlexander Barkov2020-01-281-10/+8
| | | |
* | | | MDEV-16620 JSON_ARRAYAGG and JSON_OBJECTAGG.Alexey Botchkov2019-10-141-0/+116
| | | | | | | | | | | | | | | | Ison_objectagg implemented.
* | | | MDEV-16620: Add JSON_ARRAYAGG functionMarkus Mäkelä2019-07-041-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The JSON_ARRAYAGG function extends the GROUP_CONCAT function and provides a method of aggregating JSON results. The current implementation supports DISTINCT and LIMIT but not ORDER BY (Oracle supports GROUP BY). Adding GROUP BY support is possible but it requires some extra work as the grouping appears to be done inside a temporary table that complicates matters. Added test cases that covert aggregation of all JSON types and JSON validation for the generated results.
* | | | MDEV-19897 Rename source code variable names from utf8 to utf8mb3Alexander Barkov2019-06-281-8/+8
| | | |
* | | | MDEV-19888 Add abstract class Item_json_funcAlexander Barkov2019-06-281-50/+45
|/ / /
* | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-0/+325
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3Sergei Golubchik2019-05-171-0/+325
| |\ \ | | |/
| | * MDEV-13992 Implement JSON_MERGE_PATCH.Alexey Botchkov2019-05-171-0/+325
| | | | | | | | | | | | | | | JSON_MERGE_PATCH implemented. Added JSON_MERGE_PRESERVE as a synonim for the JSON_MERGE.
* | | Merge 10.3 into 10.4Marko Mäkelä2019-03-201-2/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
| * | Merge branch '10.2' into 10.3Sergei Golubchik2019-03-171-2/+2
| |\ \ | | |/
| | * post-merge: gcc 8 warningsSergei Golubchik2019-03-151-2/+2
| | | | | | | | | | | | | | | | | | | | | note: Inherit String from Sql_alloc, to get operators new and new[] in sync in rocksdb gcc was complaining that non-lvalue was cast to const.
* | | Merge 10.3 into 10.4Marko Mäkelä2019-03-121-2/+3
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2019-03-121-2/+3
| |\ \ | | |/
| | * MDEV-18886 JSON_ARRAY() does not recognise JSON argument.Alexey Botchkov2019-03-121-2/+3
| | | | | | | | | | | | | | | | | | JSON_ARRAY and JSON_OBJECT functions with no arguments now get the connection charset. Item_func_convert_charset returns the correct is_json() flag.
* | | json helpersSergei Golubchik2018-12-121-7/+1
| | |
* | | Merge 10.3 into 10.4Marko Mäkelä2018-11-191-0/+1
|\ \ \ | |/ /
| * | Merge 10.2 into 10.3Marko Mäkelä2018-11-191-0/+1
| |\ \ | | |/
| | * MDEV-16174 Assertion `0' failed in ↵Alexey Botchkov2018-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | Type_handler_string_result::make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*) maybe_null should be always set to TRUE in Item_func_json_array_append::fix_length_and_dec()
* | | Merge 10.3 into 10.4Marko Mäkelä2018-10-051-21/+18
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3Sergei Golubchik2018-09-281-21/+18
| |\ \ | | |/
| | * MDEV-17001 JSON_MERGE returns nullwhen merging empty array.Alexey Botchkov2018-09-131-16/+13
| | | | | | | | | | | | Don't add the comma if nothing appended to the array.
| | * MDEV-17018 JSON_SEARCH and User-Defined Variables.Alexey Botchkov2018-09-121-1/+1
| | | | | | | | | | | | Item_func_json_search needs a member to store the path.
| | * MDEV-17121 JSON_ARRAY_APPEND.Alexey Botchkov2018-09-111-2/+4
| | | | | | | | | | | | Extra comma added to the result when an json array is empty.
* | | Merge 10.3 into 10.4Marko Mäkelä2018-08-161-4/+4
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3Sergei Golubchik2018-08-121-4/+4
| |\ \ | | |/
| | * MDEV-16750 JSON_SET mishandles unicode every second pair of arguments.Alexey Botchkov2018-08-061-3/+3
| | | | | | | | | | | | | | | The charset of temporary storage (Item_func_json_insert::tmp_js) was not properly set.
| | * MDEV-16869 String functions don't respect character set of JSON_VALUE.Alexey Botchkov2018-08-051-1/+1
| | | | | | | | | | | | Item_func_json_value::val_str() produced string of wrong charset.
* | | Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2018-07-251-1/+1
|\ \ \ | |/ /
| * | Merge remote-tracking branch 'origin/10.2' into 10.3Alexander Barkov2018-07-241-1/+1
| |\ \ | | |/
| | * MDEV-16814 CREATE TABLE SELECT JSON_QUOTE(multibyte_charset_expr) makes a ↵Alexander Barkov2018-07-241-1/+1
| | | | | | | | | | | | field of a wrong length
* | | Merge remote-tracking branch 'origin/10.3' into 10.4Alexander Barkov2018-07-031-48/+92
|\ \ \ | |/ /
| * | Merge branch '10.2' into 10.3Sergei Golubchik2018-06-301-27/+56
| |\ \ | | |/
| | * MDEV-16209 JSON_EXTRACT in query crashes server.Alexey Botchkov2018-06-181-26/+36
| | | | | | | | | | | | | | | The optimizer can create various item's over the original one, so we can't count on the exact item's type inside the comparison.
| | * MDEV-15905 select json_value('{"b":true}','$.b')=1 --> false withAlexey Botchkov2018-06-171-1/+20
| | | | | | | | | | | | | | | | | | | | | "Truncated incorrect DOUBLE value: 'true'". JSON_VALUE_TRUE and JSON_VALUE_FALSE should be handled specifically in Item_json_value.
| * | Merge commit '6b8802e8dd5467556a024d807a1df23940b00895' into bb-10.3-fix_len_decbb-10.3-fix_len_decOleksandr Byelkin2018-06-191-21/+36
| |\ \ | | |/