Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.2.5
-
None
-
Linux CentOS 6.4
Description
The function JSON_EXTRACT will return data and will not raise an error, even if the provided JSON is invalid JSON. It will not check the whole thing, so if the JSON up to the point of the provided JSON path is correct, that will be returned, even if the rest of the JSON data is invalid. For example
MariaDB [(none)]> select JSON_EXTRACT('{"foo": "bar" foobar foo invalid ', '$.foo');
|
+------------------------------------------------------------+
|
| JSON_EXTRACT('{"foo": "bar" foobar foo invalid ', '$.foo') |
|
+------------------------------------------------------------+
|
| "bar" |
|
+------------------------------------------------------------+
|
1 row in set (0.00 sec)
|