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

JSON in CTEs sometimes get broken

    XMLWordPrintable

Details

    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.