Details
Description
MariaDB [(none)]> SELECT JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C');
|
+---------------------------------------------+
|
| JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C') |
|
+---------------------------------------------+
|
| {"A": {"B": 1}} |
|
+---------------------------------------------+
|
1 row in set (0.00 sec)
|
which is correct.
MariaDB [(none)]> SELECT JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D');
|
+-----------------------------------------------+
|
| JSON_REMOVE('{"A": { "B": 1 }}', '$.A.B.C.D') |
|
+-----------------------------------------------+
|
| NULL |
|
+-----------------------------------------------+
|
1 row in set, 1 warning (0.00 sec)
|
 |
MariaDB [(none)]> show warnings;
|
+---------+------+---------------------------------------------------------------------+
|
| Level | Code | Message |
|
+---------+------+---------------------------------------------------------------------+
|
| Warning | 4037 | Unexpected end of JSON text in argument 1 to function 'json_remove' |
|
+---------+------+---------------------------------------------------------------------+
|
1 row in set (0.00 sec)
|
The result should be as in the first query, but we get NULL instead.
user complained there on KB
https://mariadb.com/kb/en/json_remove/#comment_4357
Attachments
Issue Links
- is duplicated by
-
MDEV-24542 JSON_REMOVE returns wrong result and ER_JSON_EOS after not finding element to remove
- Open