Details

    Description

      In mariadb 10.6 the result was good, in mariadb 10.11 give wrong result

      SET @JSON='
      {
        "SZ": [
          {
            "NAME": "S0",
            "OFFERS": [
              {
                "NAME": "S0A0"
              }
            ]
          },
          {
            "NAME": "S1",
            "OFFERS": [
              {
                "NAME": "S1A0"
              },
              {
                "NAME": "S1A1"
              }
            ]
          },
          {
            "NAME": "S2",
            "OFFERS": [
              {
                "NAME": "S2A0"
              }
            ]
          },
          {
            "NAME": "S3",
            "OFFERS": [
              {
                "NAME": "S3A0"
              }
            ]
          },
          {
            "NAME": "S4",
            "OFFERS": [
              {
                "NAME": "S4A0"
              }
            ]
          },
          {
            "NAME": "S5",
            "OFFERS": [
              {
                "NAME": "S5A0"
              }
            ]
          }
        ]
      }
       
      '
      ;
       
      #Good result S0A0 this ok in mariadb 10.11
      SELECT * FROM json_table(@JSON, '$.SZ[0].OFFERS[0]' 
      COLUMNS(NAME VARCHAR(30) PATH '$.NAME')) AS t_sz;
      #Good result no result, wrong result in 10.11
      SELECT * FROM json_table(@JSON, '$.SZ[0].OFFERS[1]' 
      COLUMNS(NAME VARCHAR(30) PATH '$.NAME')) AS t_sz;
       
      #Good result S1A1  wrong result in 10.11
      SELECT * FROM json_table(@JSON, '$.SZ[1].OFFERS[1]' 
      COLUMNS(NAME VARCHAR(30) PATH '$.NAME')) AS t_sz;
       
      #Good  result in mariadb 10.11
      select JSON_VALUE(@json, '$.SZ[1].OFFERS[1].NAME');
      
      

      Attachments

        Issue Links

          Activity

            alice Alice Sherepa added a comment -

            Thanks! I repeated on 10.9-11.8. Appeared after commit c781cefd8a (MDEV-27911)

            alice Alice Sherepa added a comment - Thanks! I repeated on 10.9-11.8. Appeared after commit c781cefd8a ( MDEV-27911 )

            People

              rucha174 Rucha Deodhar
              bulepage bulepage
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.