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

JSON in CTEs sometimes get broken

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.5.12, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
    • 10.5, 10.6, 10.11, 11.4
    • JSON, Optimizer - CTE
    • None
    • MariaDB in a docker container

    Description

      When certain JSON expressions are wrapped into a non-recursive CTE, the resulting JSON is broken:

      MariaDB [test]> SELECT JSON_SET('{"a": 1}', '$.b', 1) doc;
      +------------------+
      | doc              |
      +------------------+
      | {"a": 1, "b": 1} |
      +------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> WITH js AS (SELECT JSON_SET('{"a": 1}', '$.b', 1) doc) SELECT doc FROM js;
      +-----------------+
      | doc             |
      +-----------------+
      | {"a": 1, "b": 1 |
      +-----------------+
      1 row in set (0.000 sec)
      

      So far I've only managed to reproduce this with JSON_SET.

      Attachments

        Issue Links

          Activity

            People

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