1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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.
This commit is contained in:
Rucha Deodhar
2024-05-15 17:06:20 +05:30
parent ce9efb4e02
commit 0406b2a4ed
3 changed files with 34 additions and 9 deletions

View File

@ -1717,5 +1717,16 @@ SELECT JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D');
JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D')
{"A": {"B": 1}}
#
# MDEV-34143: Server crashes when executing JSON_EXTRACT after setting non-default collation_connection
#
SET @save_collation_connection= @@collation_connection;
SET collation_connection='utf16_bin';
SELECT JSON_EXTRACT('{"a": 1,"b": 2}','$.a');
JSON_EXTRACT('{"a": 1,"b": 2}','$.a')
NULL
Warnings:
Warning 4036 Character disallowed in JSON in argument 1 to function 'json_extract' at position 2
SET @@collation_connection= @save_collation_connection;
#
# End of 10.5 tests
#