Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
mysql> select json_extract('{"phones":["555-5555"],"emails":["info@x.com.ar"]}',"$.emails[0]");
+----------------------------------------------------------------------------------+
| json_extract('{"phones":["555-5555"],"emails":["info@x.com.ar"]}',"$.emails[0]") |
+----------------------------------------------------------------------------------+
| NULL |
+----------------------------------------------------------------------------------+
Owner

runa commented Sep 29, 2015

mysql> select json_extract('{"f":["foo"],"b":["bar"]}',"$.b[0]");
+----------------------------------------------------+
| json_extract('{"f":["foo"],"b":["bar"]}',"$.b[0]") |
+----------------------------------------------------+
| NULL                                               |
+----------------------------------------------------+

This is a bug. Funny, but select json_extract('{"f":["foo"],"b":["bar", "baz"]}',"$.b[1]"); works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment