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

JSON_VALUE and null values

    XMLWordPrintable

Details

    Description

      I have found the following bug:

      > set @xxx= JSON_INSERT('{}', '$.C', NULL);
      > select @xxx
      +-------------+
      | @xxx        |
      +-------------+
      | {"C": null} |
      +-------------+
      1 row in set (0.001 sec){quote}
       
      > select nvl(json_value(@xxx, '$.C'),'NVL-NULL-VALUE');
      +-----------------------------------------------+
      | nvl(json_value(@xxx, '$.C'),'NVL-NULL-VALUE') |
      +-----------------------------------------------+
      | null                                          |
      +-----------------------------------------------+
      1 row in set (0.001 sec)
      

      I was expecting

      > select nvl(json_value(@xxx, '$.C'),'NVL-NULL-VALUE');
      +-----------------------------------------------+
      | nvl(json_value(@xxx, '$.C'),'NVL-NULL-VALUE') |
      +-----------------------------------------------+
      | NVL-NULL-VALUE                                |
      +-----------------------------------------------+
      1 row in set (0.001 sec)
      

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              wodrsoftware Wolfgang Draxler
              Votes:
              9 Vote for this issue
              Watchers:
              12 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.