1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-23187: Assorted assertion failures in json_find_path with certain

collations

Fix by Alexey Botchkov

The 'value_len' is calculated wrong for the multibyte charsets. In the
read_strn() function we get the length of the string with the final ' " '
character. So have to subtract it's length from the value_len. And the
length of '1' isn't correct for the ucs2 charset (must be 2).
This commit is contained in:
Rucha Deodhar
2023-04-13 16:43:30 +05:30
parent 996b040f93
commit b7b8a9ee43
4 changed files with 14 additions and 10 deletions

View File

@@ -1043,9 +1043,6 @@ SELECT JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a');
JSON_EXTRACT('{"a":null, "b":10, "c":"null"}', '$.a')
null
#
# End of 10.3 tests
#
#
# Start of 10.4 tests
#
#
@@ -1295,6 +1292,11 @@ SELECT JSON_LENGTH('{"a":"b"}','$','$', 'foo');
ERROR 42000: Incorrect parameter count in the call to native function 'json_length'
SELECT JSON_LENGTH();
ERROR 42000: Incorrect parameter count in the call to native function 'JSON_LENGTH'
# MDEV-23187: Assorted assertion failures in json_find_path with certain collations
SET COLLATION_CONNECTION= ucs2_unicode_ci;
SELECT JSON_VALUE('["foo"]', '$**[0]') AS f;
f
foo
#
# End of 10.4 tests
#