Bug #80639 | use json_extract/json_set cat not select or insert value | ||
---|---|---|---|
Submitted: | 7 Mar 2016 10:22 | Modified: | 9 Mar 2016 12:04 |
Reporter: | stevenss migao | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Data Types | Severity: | S4 (Feature request) |
Version: | 5.7.10 | OS: | Red Hat (4.8.2-16) |
Assigned to: | CPU Architecture: | Any | |
Tags: | JSON JSON_EXTRACT JSON_SET |
[7 Mar 2016 10:22]
stevenss migao
[7 Mar 2016 10:37]
stevenss migao
God!! I got it. Because the UUID I used is begin with a Number~! Is this a bug??? I'm not sure...
[9 Mar 2016 12:04]
Knut Anders Hatlen
Thanks for the report. As you found out, the error is raised because the key name starts with a number. This is expected, and not a bug. See the description of the JSON path syntax here: https://dev.mysql.com/doc/refman/5.7/en/json-path-syntax.html The key name must either be an ECMAScript identifier or a double-quoted string. ECMAScript identifiers cannot start with a number, so you need to use a double-quoted string for this key. The following should work: select json_extract(info_detail, '$.contacts."1fc7e5c4e4174cf593baa1d7349a5037"') from t_user_info where id = 3000