Bug #70394 | MySQL JSON UDFs: json_replace can generate invalid target JSON | ||
---|---|---|---|
Submitted: | 22 Sep 2013 1:28 | Modified: | 5 Mar 2014 22:44 |
Reporter: | Roland Bouman | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: JSON User-defined function ( UDF ) | Severity: | S4 (Feature request) |
Version: | 0.2.0 | OS: | Any |
Assigned to: | Sveta Smirnova | CPU Architecture: | Any |
Tags: | mysql-json-udfs-0.2.0 |
[22 Sep 2013 1:28]
Roland Bouman
[22 Sep 2013 5:26]
MySQL Verification Team
Hello Roland, Thank you for the bug report. Verified as described. Thanks, Umesh
[6 Nov 2013 8:58]
Sveta Smirnova
This is known limitation of this version: you should use '""' instead.
[5 Mar 2014 22:43]
Sveta Smirnova
Posted by developer: Fixed in version 0.3.1. Now new values, passed to functions JSON_APPEND, JSON_REPLACE, JSON_SET as numbers, empty strings or NULLs are converted to JSON objects. Objects, passed as strings are not converted: you are still responsible to put quotes around string values. This is done by purpose, because it is not possible to distinguish if value, passed as '[1, 2, 3' should be really string "[1, 2, 3" or this is a typo and user should insert closing bracket instead. Also functions JSON_APPEND, JSON_REPLACE, JSON_SET check if element which needs to be inserted is valid JSON value. If it is not: NULL returned.