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

IF and COALESCE lose "json" property

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.5, 10.6, 10.2(EOL), 10.3(EOL), 10.4(EOL)
    • 10.5.14, 10.6.6, 10.7.2, 10.8.1
    • JSON
    • None

    Description

      MariaDB [test]> select json_object('a', json_object('b', 'c'));
      +-----------------------------------------+
      | json_object('a', json_object('b', 'c')) |
      +-----------------------------------------+
      | {"a": {"b": "c"}}                       |
      +-----------------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> select json_object('a', if(1, json_object('b', 'c'), json_object('e', 'f')));
      +-----------------------------------------------------------------------+
      | json_object('a', if(1, json_object('b', 'c'), json_object('e', 'f'))) |
      +-----------------------------------------------------------------------+
      | {"a": "{\"b\": \"c\"}"}                                               |
      +-----------------------------------------------------------------------+
      1 row in set (0.001 sec)
       
      MariaDB [test]> select json_object('a', coalesce(json_object('b', 'c')));
      +---------------------------------------------------+
      | json_object('a', coalesce(json_object('b', 'c'))) |
      +---------------------------------------------------+
      | {"a": "{\"b\": \"c\"}"}                           |
      +---------------------------------------------------+
      1 row in set (0.000 sec)
      

      other functions (CASE, NULLIF, IFNULL) are likely affected too.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              serg Sergei Golubchik
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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