Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-11858

json_merge() concatenates instead of merging

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.2(EOL)
    • 10.2.4
    • JSON

    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"]}                    |
      

      Attachments

        Activity

          anikitin Andrii Nikitin (Inactive) created issue -
          anikitin Andrii Nikitin (Inactive) made changes -
          Field Original Value New Value
          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 :

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

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

          {code:sql}
          MariaDB [test]> select json_merge('{"a":"b"}', '{"a":"c"}') ;
          | {"a": ["b", "c"]} |
          {sql}
          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 :

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

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

          {code:sql}
          MariaDB [test]> select json_merge('{"a":"b"}', '{"a":"c"}') ;
          | {"a": ["b", "c"]} |
          {code}
          anikitin Andrii Nikitin (Inactive) made changes -
          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 :

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

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

          {code:sql}
          MariaDB [test]> select json_merge('{"a":"b"}', '{"a":"c"}') ;
          | {"a": ["b", "c"]} |
          {code}
          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 :

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

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

          {code:sql}
          mysql > select json_merge('{"a":"b"}', '{"a":"c"}') ;
          | {"a": ["b", "c"]} |
          {code}
          elenst Elena Stepanova made changes -
          Affects Version/s 10.2 [ 14601 ]
          elenst Elena Stepanova made changes -
          Labels 10.2-rc
          holyfoot Alexey Botchkov made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          holyfoot Alexey Botchkov made changes -
          issue.field.resolutiondate 2017-02-09 21:24:53.0 2017-02-09 21:24:53.39
          holyfoot Alexey Botchkov made changes -
          Fix Version/s 10.2.4 [ 22116 ]
          Fix Version/s 10.2 [ 14601 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 79303 ] MariaDB v4 [ 151570 ]

          People

            holyfoot Alexey Botchkov
            anikitin Andrii Nikitin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.