| Bug #81283 | JSON replace or merge_replace function | ||
|---|---|---|---|
| Submitted: | 2 May 2016 14:24 | Modified: | 1 Aug 2017 6:07 |
| Reporter: | Manyi Lu | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: JSON | Severity: | S4 (Feature request) |
| Version: | 8.0 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | json, merge, sql functions | ||
[10 May 2016 4:56]
MySQL Verification Team
Hello Manyi Lu, Thank you for the reasonable feature request! Thanks, Umesh
[1 Aug 2017 6:07]
Jon Stephens
Fixed in MySQL 8.0.3 through addition of JSON_MERGE_PATCH() function and renaming of JSON_MERGE() to JSON_MERGE_PRESERVE(). Closed.

Description: Michael Slowik requested this feature at MySQL Innovation Day. JSON_MERGE('{ "a": 1, "b":2 }','{ "a": 3, "c":4 }'); returns { "a": [1,3], "b":2, "c": 4} He wants a JSON_Merge_Replace function. JSON_Merge_Replace('{ "a": 1, "b":2}','{ "a": 3, "c":4 }'); returns '{ "a": 3, "b":2, "c": 4}' How to repeat: JSON_MERGE('{ "a": 1, "b":2 }','{ "a": 3, "c":4 }'); returns { "a": [1,3], "b":2, "c": 4} He wants a JSON_Merge_Replace function. JSON_Merge_Replace('{ "a": 1, "b":2}','{ "a": 3, "c":4 }'); returns '{ "a": 3, "b":2, "c": 4}'