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

@ -1147,6 +1147,18 @@ SELECT JSON_TYPE(json_value(JSON_OBJECT("id", 1, "name", 'Monty', "date", Cast('
SELECT JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D');
--echo #
--echo # MDEV-34143: Server crashes when executing JSON_EXTRACT after setting non-default collation_connection
--echo #
SET @save_collation_connection= @@collation_connection;
SET collation_connection='utf16_bin';
SELECT JSON_EXTRACT('{"a": 1,"b": 2}','$.a');
SET @@collation_connection= @save_collation_connection;
--echo #
--echo # End of 10.5 tests
--echo #