1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-24 19:42:23 +03:00
Commit Graph

206 Commits

Author SHA1 Message Date
a88c71b294 MDEV-35041 Simple comparison causes "Illegal mix of collations" even with default server settings
The task "MDEV-25829 Change default Unicode collation to uca1400_ai_ci"
previously changed collation derivation for string user variables
from DERIVATION_EXPLICIT to DERIVATION_COERCIBLE, to resolve illegal
collation mix conflicts between table columns and user variables
when they have different collations.

However, DERIVATION_COERCIBLE was a wrong choice because it caused
conflicts between string literals and user variables when they have
different collations.

Adding a new collation derivation level DERIVATION_USERVAR.
This makes the collation of a user variable:
- weaker than a table column (like it was intended by MDEV-25829)
- but stronger than a literal (like it was in pre-MDEV-25829)

Cleanup in sql_type.h:
  Removing the line "- BINARY(expr)" from the before-DERIVATION_CAST
  comment, as it was on a wrong place. It's also listed on the correct
  place before DERIVATION_IMPLICIT.
2024-10-28 16:30:49 +04:00
43465352b9 Merge 11.4 into 11.6 2024-10-03 16:09:56 +03:00
12a91b57e2 Merge 10.11 into 11.2 2024-10-03 13:24:43 +03:00
63913ce5af Merge 10.6 into 10.11 2024-10-03 10:55:08 +03:00
753e7d6d7c MDEV-27412: JSON_TABLE doesn't properly unquote strings
Analysis:
The value gets appended as string instead of unescaped json value

Fix:
Append the value of json in a temporary string and then store it in the
field instead of directly storing as string.
2024-10-01 13:45:46 +05:30
36eba98817 MDEV-19123 Change default charset from latin1 to utf8mb4
Changing the default server character set from latin1 to utf8mb4.
2024-07-11 10:21:07 +04:00
4e805aed85 Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-10 12:17:09 +04:00
8f4ec79d09 Merge remote-tracking branch 'origin/11.4' into 11.5 2024-07-08 12:25:04 +04:00
2455f1a93d MDEV-31543: ASAN heap-buffer-overflow in strncpy when fetching keys
using JSON_OBJECT_FILTER_KEYS function

Analysis:
Insufficient buffer size while copying the data.
Fix:
Change buffer size to accomodate all data.
2024-06-24 14:16:40 +05:30
a21e49cbcc Merge 11.1 into 11.2 2024-06-17 12:02:03 +03:00
d34289a3e2 Merge 10.11 into 11.1 2024-06-17 09:21:50 +03:00
b81d717387 Merge 10.6 into 10.11 2024-06-11 12:50:10 +03:00
a687cf8661 Merge 10.5 into 10.6 2024-06-07 10:03:51 +03:00
0406b2a4ed MDEV-34143: Server crashes when executing JSON_EXTRACT after setting
non-default collation_connection

Analysis:
Due to different collation, the string has nothing to chop off.

Fix:
Got rid of chop(), only append " ," only when we have more elements to
add to the result.
2024-06-06 11:41:01 +05:30
283b9285c3 MDEV-33701 upgrades from 11.4 to 11.5 don't work
A user variable and a literal with different collation
produce an illegal mix of collation error.
Rewriting the script to avoid such arguments.
2024-05-25 03:31:36 +04:00
903b5d6a83 MDEV-25829 Change default Unicode collation to uca1400_ai_ci
Step#3 The main patch
2024-05-24 15:50:05 +04:00
dd7d9d7fb1 Merge branch '11.4' into 11.5 2024-05-23 17:01:43 +02:00
bf5da43e50 Merge branch '11.1' into 11.2 2024-05-13 10:00:26 +02:00
f0a5412037 Merge branch '11.0' into 11.1 2024-05-13 09:52:30 +02:00
f9807aadef Merge branch '10.11' into 11.0 2024-05-12 12:18:28 +02:00
a6b2f820e0 Merge branch '10.6' into 10.11 2024-05-10 20:02:18 +02:00
7b53672c63 Merge branch '10.5' into 10.6 2024-05-08 20:06:00 +02:00
d74fee9e8c MDEV-19487 fix for --view
followup for d7df63e1c9
2024-05-05 21:37:08 +02:00
9e6858a426 MDEV-22141: JSON_REMOVE returns NULL on valid arguments
Analysis:
When we scan json to get to a beginning according to the path, we end up
scanning json even if we have exhausted it. When eventually returns error.

Fix:
Continue scanning json only if we have not exhausted it and return result
accordingly.
2024-04-29 22:32:17 +05:30
5ca64e65d0 MDEV-32287: JSON_EXTRACT not returning multiple values for same path
Analysis:
When scanning json and getting the exact path at each step, if a path
is reached, we end up adding the item in the result and immediately get the
next item which results in current path changing.
Fix:
Instead of immediately returning the item, count the occurences of the path
in argument and append in the result as needed.
2024-04-29 22:32:17 +05:30
d7df63e1c9 MDEV-19487: JSON_TYPE doesnt detect the type of String Values
(returns NULL) and for Date/DateTime returns "INTEGER"

Analysis:
When the first character of json is scanned it is number. Based on that
integer is returned.
Fix:
Scan rest of the json before returning the final result to ensure json is
valid in the first place in order to have a valid type.
2024-04-29 22:32:17 +05:30
c6e3fe29d4 MDEV-30646 View created via JSON_ARRAYAGG returns incorrect json object
Backporting add782a13e from 10.6, this fixes the problem.
2024-04-29 13:47:45 +04:00
018d537ec1 Merge branch '10.6' into 10.11 2024-04-22 15:23:10 +02:00
41296a07c8 Merge branch '10.5' into 10.6 2024-04-11 13:58:22 +02:00
cd28b2479c Merge branch '11.1' into 11.2 2024-04-09 12:12:33 +02:00
3c40f8bafb MDEV-31402: SIGSEGV in json_get_path_next | Item_func_json_extract::read_json 2024-04-08 19:19:39 +05:30
683fbced6b Merge 11.0 into 11.1 2024-03-28 12:15:36 +02:00
fec2fd6add Merge 10.11 into 11.0 2024-03-28 10:51:36 +02:00
788953463d Merge 10.6 into 10.11
Some fixes related to commit f838b2d799 and
Rows_log_event::do_apply_event() and Update_rows_log_event::do_exec_row()
for system-versioned tables were provided by Nikita Malyavin.
This was required by test versioning.rpl,trx_id,row.
2024-03-28 09:16:57 +02:00
f71d7f2f0f Merge branch '10.5' into 10.6 2024-03-13 21:02:34 +01:00
f703e72bd8 Merge 10.4 into 10.5 2024-03-11 10:08:20 +02:00
b93252a303 MDEV-32454 JSON test has problem in view protocol.
Few Item_func_json_xxx::fix_length_and_dec() functions fixed.
2024-03-02 14:58:57 +04:00
929c2e06aa MDEV-31531 Remove my_casedn_str() and my_caseup_str()
Under terms of MDEV 27490 we'll add support for non-BMP identifiers
and upgrade casefolding information to Unicode version 14.0.0.
In Unicode-14.0.0 conversion to lower and upper cases can increase octet length
of the string, so conversion won't be possible in-place any more.

This patch removes virtual functions performing in-place casefolding:
  - my_charset_handler_st::casedn_str()
  - my_charset_handler_st::caseup_str()
and fixes the code to use the non-inplace functions instead:
  - my_charset_handler_st::casedn()
  - my_charset_handler_st::caseup()
2024-02-28 22:20:29 +04:00
79580f4f96 Merge branch '11.1' into 11.2 2024-02-02 17:43:57 +01:00
b6680e0101 Merge branch '11.0' into 11.1 2024-02-02 11:30:47 +01:00
87e13722a9 Merge branch '10.6' into 10.11 2024-02-01 18:36:14 +01:00
3f6038bc51 Merge branch '10.5' into 10.6 2024-01-31 18:04:03 +01:00
01f6abd1d4 Merge branch '10.4' into 10.5 2024-01-31 17:32:53 +01:00
fe490f85bb Merge branch '10.11' into 11.0 2024-01-30 08:54:10 +01:00
14d930db5d Merge branch '10.6' into 10.11 2024-01-30 08:17:58 +01:00
25c0806867 Merge branch '10.5' into 10.6 2024-01-30 07:43:15 +01:00
50107c4b22 Merge branch '10.4' into 10.5 2024-01-30 07:26:17 +01:00
615f4a8c9e MDEV-32587 Allow json exponential notation starting with zero
Modify the NS_ZERO state in the JSON number parser to allow
exponential notation with a zero coefficient (e.g. 0E-4).

The NS_ZERO state transition on 'E' was updated to move to the
NS_EX state rather than returning a syntax error. Similar change
was made for the NS_ZE1 (negative zero) starter state.

This allows accepted number grammar to include cases like:

- 0E4
- -0E-10

which were previously disallowed. Numeric parsing remains
the same for all other states.

Test cases are added to func_json.test to validate parsing for
various exponential numbers starting with zero coefficients.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services.
2024-01-17 19:25:43 +05:30
fef31a26f3 Merge branch '11.1' into 11.2 2023-12-20 23:43:05 +01:00
fa2e1c3948 MDEV-33015: Server crashes upon JSON_SCHEMA_VALID reading NULL from a user
variable

Analysis:
Since the item is NULL, it's json value is NULL but we proceed to parse
it anyway.
Fix:
If json value is NULL, return NULL.
2023-12-18 14:14:55 +05:30