Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5.5
-
None
-
None
-
None
Description
Consider this:
MariaDB [test]> select json_extract('{"a": { "b": "1234" }}', '$.a');
|
+-----------------------------------------------+
|
| json_extract('{"a": { "b": "1234" }}', '$.a') |
|
+-----------------------------------------------+
|
| {"b": "1234"} |
|
+-----------------------------------------------+
|
1 row in set (0.000 sec)
|
|
MariaDB [test]> select json_compact(json_extract('{"a": { "b": "1234" }}', '$.a'));
|
+-------------------------------------------------------------+
|
| json_compact(json_extract('{"a": { "b": "1234" }}', '$.a')) |
|
+-------------------------------------------------------------+
|
| {"b":"1234"} |
|
+-------------------------------------------------------------+
|
1 row in set (0.000 sec)
|
|
MariaDB [test]> select json_unquote(json_compact(json_extract('{"a": { "b": "1234" }}', '$.a')));
|
+---------------------------------------------------------------------------+
|
| json_unquote(json_compact(json_extract('{"a": { "b": "1234" }}', '$.a'))) |
|
+---------------------------------------------------------------------------+
|
| {"b": "1234"} |
|
+---------------------------------------------------------------------------+
|
1 row in set (0.000 sec)
|
Note the added space after the colon (:). Considering that the documentation states:
If the given value is not a JSON string, value is passed through unmodified.
|
json_unquote should not do that.