[MDEV-11858] json_merge() concatenates instead of merging Created: 2017-01-21  Updated: 2017-02-09  Resolved: 2017-02-09

Status: Closed
Project: MariaDB Server
Component/s: JSON
Affects Version/s: 10.2
Fix Version/s: 10.2.4

Type: Bug Priority: Major
Reporter: Andrii Nikitin (Inactive) Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: 10.2-rc


 Description   

I am not sure where to refer what "json merge" means formally, but looking in several places makes me think that current 10.2 behavior is incorrect :

MariaDB [test]> select json_merge('{"a":"b"}', '{"a":"c"}') ;
| {"a":"b", "a":"c"}                   |

While both http://tools.knowledgewalls.com/onlinejsonmerger and MySQL 5.7 show:

mysql > select json_merge('{"a":"b"}', '{"a":"c"}') ;
| {"a": ["b", "c"]}                    |



 Comments   
Comment by Andrii Nikitin (Inactive) [ 2017-01-22 ]

It looks that (some) standard ( https://tools.ietf.org/html/rfc7386 ) defines expected result of this operation as

'{"a":"c"}'

Comment by Alexey Botchkov [ 2017-02-09 ]

http://lists.askmonty.org/pipermail/commits/2017-February/010663.html

Generated at Thu Feb 08 07:53:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.