Details
-
Bug
-
Status: Closed (View Workflow)
-
Trivial
-
Resolution: Fixed
-
10.10.3
-
None
Description
According to the docs here: https://mariadb.com/kb/en/json_insert/
> Inserts data into a JSON document, returning the resulting document or NULL if any argument is null.
I'm assuming the docs are just worded incorrectly.
Passing 3 arguments of which the 2nd is NULL returns NULL, while consistent with docs this feels weird since other incorrect path strings generate errors
Proposal 1:
Fix docs to say "Inserts data into a JSON document, returning the resulting document or NULL if the json_doc or any path is null.
Proposal 2:
Fix JSON_INSERT and family to never return NULL on invalid arguments. The returning of NULL in cases of bad paths can lead to destructive writes and forces every developer to check these cases.