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

JSON_ARRAYAGG + JSON_TABLE + GROUP BY charset issue

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4.8
    • None
    • Character Sets, JSON
    • None
    • x86_64 Linux

    Description

      I am seeing a charset edge case under a very specific set of circumstances.

      Related: https://jira.mariadb.org/browse/MDEV-24784 (I can reproduce this bug in server 11.4.8, which is higher than than the versions marked as "fixed" in this issue.)

      I have minified the test case so it works in a single SELECT statement without creating tables.

      1. Test case

      SELECT
          JSON_VALUE(JSON_ARRAYAGG('×'), "$[0]") AS working,
          JSON_EXTRACT(JSON_ARRAYAGG('×'), "$[0]") AS broken,
          JSON_ARRAYAGG('×') AS also_broken
      FROM information_schema.engines,
           JSON_TABLE(1, '$' COLUMNS (x FOR ORDINALITY)) j
      GROUP BY engine
      LIMIT 1;
      

      1. Expected outcome

      1. Column one shows something
      2. Column two shows the column one thing enclosed in double quotation marks
      3. Column three shows the column one thing enclosed in square brackets

      1. Actual outcome

        1. `×` ✅
        2. `"?"` ❌
        3. `["?"]` ❌
        

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fulldecent William Entriken
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.