| Bug #86213 | JSON_INSERT does not handle auto-wrapping | ||
|---|---|---|---|
| Submitted: | 8 May 2017 11:46 | Modified: | 8 Aug 2017 15:35 |
| Reporter: | Knut Anders Hatlen | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: JSON | Severity: | S3 (Non-critical) |
| Version: | 5.7.18 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[8 May 2017 11:46]
Knut Anders Hatlen
[8 May 2017 11:57]
Knut Anders Hatlen
Posted by developer:
Similar problem in JSON_ARRAY_INSERT:
mysql> select json_array_insert('{"a":[1]}', '$.a[1]', 123) as c1,
-> json_array_insert('{"a":[1]}', '$[0].a[1]', 123) as c2;
+-----------------+------------+
| c1 | c2 |
+-----------------+------------+
| {"a": [1, 123]} | {"a": [1]} |
+-----------------+------------+
1 row in set (0,00 sec)
[8 Aug 2017 15:35]
Jon Stephens
Documented fix in the MySQL 8.0.3 changelog as follows:
When a path_expression identified a nonarray value, the
JSON_INSERT() and JSON_ARRAY_INSERT() functions failed to
evaluate path_expression[0] as being equal to path_expression.
Closed.
