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

JSON_EXTRACT not returning multiple values for same path

Details

    Description

      MariaDB [(none)]> select JSON_EXTRACT("[1, 2, [30, 40]]", '$[2][1]', '$[2][1]');
      +--------------------------------------------------------+
      | JSON_EXTRACT("[1, 2, [30, 40]]", '$[2][1]', '$[2][1]') |
      +--------------------------------------------------------+
      | [40]                                                   |
      +--------------------------------------------------------+
      

      While MySQL:

      +--------------------------------------------------------+
      | JSON_EXTRACT("[1, 2, [30, 40]]", '$[2][1]', '$[2][1]') |
      +--------------------------------------------------------+
      | [40, 40]                                               |
      +--------------------------------------------------------+
      

      Documentation in our case says it should so I consider this a bug.

      Attachments

        Activity

          rucha174 Rucha Deodhar added a comment - patch: https://github.com/MariaDB/server/commit/6e66d5bbfa00d53c06fc3df8ca98e85a684d7c1c

          ok to push.

          Personally i think the way it worked in MariaDB made more sence. But since we decided to copy MySQL's behaviour for these functions we have to do the change.

          holyfoot Alexey Botchkov added a comment - ok to push. Personally i think the way it worked in MariaDB made more sence. But since we decided to copy MySQL's behaviour for these functions we have to do the change.

          People

            rucha174 Rucha Deodhar
            cvicentiu Vicențiu Ciorbaru
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.