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

JSON_EXTRACT not respecting order of paths when returning results

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4(EOL), 10.5, 10.6, 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL)
    • 10.5, 10.6, 10.11
    • None
    • None

    Description

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

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

      The result should not be the same.

      MySQL:

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

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            cvicentiu Vicențiu Ciorbaru
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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