X
  • MySQL
    December 31, 2013

JSON UDF functions version 0.3.0 have been released.

Guest Author
Today new version of JSON UDF functions: 0.3.0 was released. This is major release which contains new functionality. You can download functions from the MySQL Labs website.

What was added?

Functions JSON_EXTRACT, JSON_CONTAINS_KEY, JSON_APPEND, JSON_REMOVE, JSON_REPLACE, JSON_SET now accept both string and integer arguments as array indexes. (Bug #70393/17491709)

Now syntax JSON_EXTRACT(doc, 'key', 1); is accepted.

New function JSON_SAFE_MERGE checks JSON documents for validity before merging them. In addition JSON_MERGE now merges valid documents, having array as root element. (Bug #70575/17583568)

JSON_VALID now accepts array as a root element of the JSON document (Bug #70567/17583282)

Also this release contains following bug fixes:

71050/17882710 json_extract returning same column twice if key names are not fully distinct. (Fixed for JSON_EXTRACT, JSON_CONTAINS_KEY, JSON_APPEND, JSON_REMOVE, JSON_REPLACE, JSON_SET)

71180/17975709 JSON_CONTAINS_KEY founds not existent key in the array element

70579/17584678 Add ability to append last element to array in JSON_APPEND

And, of course, this release contains all changes which version 0.2.1 has

Join the discussion

Comments ( 7 )
  • Yaniv Hakim Sunday, February 23, 2014

    Hi Sveta,

    These JSON Udf's are potentially just gold for MySQL!

    But I have one problem to use them.

    The only function I really need is the JSON merge but currently when merging two json docs it duplicates key's and values that are present on both the docs being merged instead of just updates the value with the new doc... for example: json_merge( {"a":"b"}, {"a":"c"} ) returns: {"a":"b","a":"c"} instead of: {"a":"c"}

    this is causing the returned doc to be non serializable and i think non legal json.

    what i really need is a function that acts like json_set but for two json docs..

    can you please add this?

    thanks!


  • Sveta Smirnova Sunday, February 23, 2014

    Hi Yaniv,

    yes, I can consider adding this feature. Please file a request at bugs.mysql.com under JSON UDF category.


  • Yaniv Hakim Sunday, February 23, 2014

    Thanks! :)

    I filed a bug as you requested.

    Looking forward for your fix!


  • it support Monday, July 7, 2014

    These JSON Udf's are potentially just gold for MySQL!

    But I have one problem to use them.


  • Sveta Smirnova Monday, July 7, 2014

    Thank you, it support, for the compliments!

    But which problem do you have?


  • guest Tuesday, December 23, 2014

    how can I get it? and install it?


  • Sveta Smirnova Tuesday, December 23, 2014

    Dowload from MySQL Labs at http://labs.mysql.com/, use instructions in README file to install


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha