1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Rucha Deodhar
2024-03-16 00:28:48 +05:30
parent 5ca64e65d0
commit 9e6858a426
3 changed files with 14 additions and 0 deletions

View File

@ -1140,6 +1140,13 @@ DROP TABLE t;
SELECT JSON_TYPE(json_value(JSON_OBJECT("id", 1, "name", 'Monty', "date", Cast('2019-01-01' as Date) ), '$.date'));
--echo #
--echo # MDEV-22141: JSON_REMOVE returns NULL on valid arguments
--echo #
SELECT JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D');
--echo #
--echo # End of 10.5 tests
--echo #