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

IF and COALESCE lose "json" property

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6
    • 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

            Transition Time In Source Status Execution Times
            Alexander Barkov made transition -
            Open Confirmed
            25d 15h 25m 1
            Alexander Barkov made transition -
            Confirmed In Progress
            21d 2h 8m 1
            Alexander Barkov made transition -
            In Progress In Review
            3h 56m 1
            Alexander Barkov made transition -
            Stalled In Review
            2d 3h 19m 2
            Sergei Golubchik made transition -
            In Review Stalled
            21d 18h 49m 3
            Alexander Barkov made transition -
            Stalled Closed
            1d 5h 4m 1

            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.